[Xcb] BitBlt like method?

Nadeem Syed nadeem0319 at hotmail.com
Mon Nov 23 09:12:35 PST 2009


" Summary: don't. There's probably a better way to do what you're really
  trying to do. Why are you trying to scan a pixmap for a specific
  color? "

 

Is there a better way to scan for a specific color? Please do tell :) Or would it be better to go back to Xlib if there is no good solution for XCB yet?


 
> Date: Mon, 23 Nov 2009 09:54:53 -0500
> Subject: Re: [Xcb] BitBlt like method?
> From: git at peter.is-a-geek.org
> To: itcppower at hotmail.com
> CC: xcb at lists.freedesktop.org
> 
> On Sun, Nov 22, 2009 at 9:15 PM, IT CPPower wrote:
> > I'm trying to for a specific color on the specified Window/Child (HDC), and
> > return the location of that pixel. I'm creating a shared library, and since
> > it'll be cross-platform  I'll need the alternate of HDC because how else
> > would I specify the target window I need to search for the color in right?
> > (In windows i'd get a HDC like 5647382, and pass that onto
> > CreateDIBSection/BitBlt and then use something like GetObject->bmBits to get
> > the colors data and then search in there). I need to do this in Linux now...
> 
> A question very much like this one was answered only yesterday:
> http://lists.freedesktop.org/archives/xcb/2009-November/005342.html
> 
> Summary: don't. There's probably a better way to do what you're really
> trying to do. Why are you trying to scan a pixmap for a specific
> color?
> 
> To answer the direct question: A GC is somewhat like an HDC, in that
> it holds the brush (and the rest of the context), but in X11 the GC
> does not bind to a particular drawable (window or pixmap). CopyArea is
> the equivalent to BitBlt, and it takes a source drawable, a
> destination drawable, and a GC (unlike BitBlt, which only takes a
> source and destination DC). GetImage (to replace your GetObject) takes
> xcb_window_t (like HWND) or xcb_pixmap_t (like HBITMAP) directly.
> 
> Peter Harris
 		 	   		  
_________________________________________________________________
Eligible CDN College & University students can upgrade to Windows 7 before Jan 3 for only $39.99. Upgrade now!
http://go.microsoft.com/?linkid=9691819
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xcb/attachments/20091123/1c26021d/attachment.html 


More information about the Xcb mailing list