<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[GetPixel Rückgabewert zu groß?]]></title><description><![CDATA[<p>Ich erhalte als Rückgabewert von GetPixel: ffffffff;<br />
Aber es soll doch ein RGB Wert sein und dürfte damit nur 6 Stellen haben?<br />
Was mache ich falsch?</p>
<pre><code>COLORREF GetColorOfPixel(DWORD x, DWORD y, HWND hWnd)
{
    HDC hDC = GetDC(hWnd);
    COLORREF cr = GetPixel(hDC,x,y);
    ReleaseDC(hWnd, hDC);
    return cr;
}

...

HWND hWnd = WindowFromPoint(point);
farbe1 = GetColorOfPixel(220,150, hWnd);
printf(&quot;\nHexadezimal: %x\n&quot;, farbe1);
</code></pre>
<p>Im MSDN steht noch:<br />
An application should call GetDeviceCaps to determine whether a specified device supports this function.</p>
<p>Was hat es damit auf sich? Verstehe nicht so ganz wie ich die Funktionen benuten soll.<br />
Dank vorab</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/242940/getpixel-rückgabewert-zu-groß</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 12:28:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242940.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Jun 2009 00:09:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetPixel Rückgabewert zu groß? on Wed, 10 Jun 2009 00:09:38 GMT]]></title><description><![CDATA[<p>Ich erhalte als Rückgabewert von GetPixel: ffffffff;<br />
Aber es soll doch ein RGB Wert sein und dürfte damit nur 6 Stellen haben?<br />
Was mache ich falsch?</p>
<pre><code>COLORREF GetColorOfPixel(DWORD x, DWORD y, HWND hWnd)
{
    HDC hDC = GetDC(hWnd);
    COLORREF cr = GetPixel(hDC,x,y);
    ReleaseDC(hWnd, hDC);
    return cr;
}

...

HWND hWnd = WindowFromPoint(point);
farbe1 = GetColorOfPixel(220,150, hWnd);
printf(&quot;\nHexadezimal: %x\n&quot;, farbe1);
</code></pre>
<p>Im MSDN steht noch:<br />
An application should call GetDeviceCaps to determine whether a specified device supports this function.</p>
<p>Was hat es damit auf sich? Verstehe nicht so ganz wie ich die Funktionen benuten soll.<br />
Dank vorab</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1724217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1724217</guid><dc:creator><![CDATA[TegMiles]]></dc:creator><pubDate>Wed, 10 Jun 2009 00:09:38 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel Rückgabewert zu groß? on Wed, 10 Jun 2009 00:13:37 GMT]]></title><description><![CDATA[<p>MSDN schrieb:</p>
<blockquote>
<p>The return value is the RGB value of the pixel. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.</p>
</blockquote>
<p>( <code>CLR_INVALID == 0xFFFFFFFF</code> )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1724219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1724219</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Wed, 10 Jun 2009 00:13:37 GMT</pubDate></item></channel></rss>