<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<EM>" Summary: don't. There's probably a better way to do what you're really<BR> trying to do. Why are you trying to scan a pixmap for a specific<BR> color? "</EM><BR>
<EM></EM> <BR>
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?<BR>
<BR> <BR>> Date: Mon, 23 Nov 2009 09:54:53 -0500<BR>> Subject: Re: [Xcb] BitBlt like method?<BR>> From: git@peter.is-a-geek.org<BR>> To: itcppower@hotmail.com<BR>> CC: xcb@lists.freedesktop.org<BR>> <BR>> On Sun, Nov 22, 2009 at 9:15 PM, IT CPPower wrote:<BR>> > I'm trying to for a specific color on the specified Window/Child (HDC), and<BR>> > return the location of that pixel. I'm creating a shared library, and since<BR>> > it'll be cross-platform I'll need the alternate of HDC because how else<BR>> > would I specify the target window I need to search for the color in right?<BR>> > (In windows i'd get a HDC like 5647382, and pass that onto<BR>> > CreateDIBSection/BitBlt and then use something like GetObject->bmBits to get<BR>> > the colors data and then search in there). I need to do this in Linux now...<BR>> <BR>> A question very much like this one was answered only yesterday:<BR>> http://lists.freedesktop.org/archives/xcb/2009-November/005342.html<BR>> <BR>> Summary: don't. There's probably a better way to do what you're really<BR>> trying to do. Why are you trying to scan a pixmap for a specific<BR>> color?<BR>> <BR>> To answer the direct question: A GC is somewhat like an HDC, in that<BR>> it holds the brush (and the rest of the context), but in X11 the GC<BR>> does not bind to a particular drawable (window or pixmap). CopyArea is<BR>> the equivalent to BitBlt, and it takes a source drawable, a<BR>> destination drawable, and a GC (unlike BitBlt, which only takes a<BR>> source and destination DC). GetImage (to replace your GetObject) takes<BR>> xcb_window_t (like HWND) or xcb_pixmap_t (like HBITMAP) directly.<BR>> <BR>> Peter Harris<BR>                                            <br /><hr />Get Windows 7 for only $39.99-CDN College or University students only. <a href='http://go.microsoft.com/?linkid=9691814' target='_new'>This offer ends Jan 3-upgrade now!</a></body>
</html>