<?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[GetRValue(); Problem]]></title><description><![CDATA[<p>Hallo</p>
<p>Habe ein Problem. Will der Farbwert eines Pixels auslesen und<br />
ausgeben. Ich erhalte jedoch IMMER auf allen Werten 255. Hab mit<br />
verschiedenen Vartypen für red, green, blue getestet und viel<br />
Gegooglet.<br />
Thx 4 Help</p>
<pre><code class="language-cpp">int red, green, blue;

int main(int argc, char *argv[])
{
    Sleep(3000);
    HWND hWnd;
    HDC hDC;
    COLORREF Pixel;
    hWnd = FindWindow(0,&quot;Programmtitel&quot;);
    if(hWnd = NULL)
            cout &lt;&lt; &quot;hWnd ungültig&quot; &lt;&lt; endl;
    hDC = GetDC(hWnd);
    if(hDC = NULL)
            cout &lt;&lt; &quot;hDC ungültig&quot; &lt;&lt; endl;
    SetCursorPos(500,500);
    Pixel   = GetPixel(hDC, 500,500);
    red     = GetRValue(Pixel);
    green   = GetGValue(Pixel);
    blue    = GetBValue(Pixel);
    cout &lt;&lt; red   &lt;&lt; endl;
    cout &lt;&lt; green &lt;&lt; endl;
    cout &lt;&lt; blue  &lt;&lt; endl;
    ReleaseDC(hWnd, hDC);
    Sleep(5000);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/184972/getrvalue-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 17:08:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/184972.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jun 2007 17:47:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetRValue(); Problem on Wed, 20 Jun 2007 17:47:31 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Habe ein Problem. Will der Farbwert eines Pixels auslesen und<br />
ausgeben. Ich erhalte jedoch IMMER auf allen Werten 255. Hab mit<br />
verschiedenen Vartypen für red, green, blue getestet und viel<br />
Gegooglet.<br />
Thx 4 Help</p>
<pre><code class="language-cpp">int red, green, blue;

int main(int argc, char *argv[])
{
    Sleep(3000);
    HWND hWnd;
    HDC hDC;
    COLORREF Pixel;
    hWnd = FindWindow(0,&quot;Programmtitel&quot;);
    if(hWnd = NULL)
            cout &lt;&lt; &quot;hWnd ungültig&quot; &lt;&lt; endl;
    hDC = GetDC(hWnd);
    if(hDC = NULL)
            cout &lt;&lt; &quot;hDC ungültig&quot; &lt;&lt; endl;
    SetCursorPos(500,500);
    Pixel   = GetPixel(hDC, 500,500);
    red     = GetRValue(Pixel);
    green   = GetGValue(Pixel);
    blue    = GetBValue(Pixel);
    cout &lt;&lt; red   &lt;&lt; endl;
    cout &lt;&lt; green &lt;&lt; endl;
    cout &lt;&lt; blue  &lt;&lt; endl;
    ReleaseDC(hWnd, hDC);
    Sleep(5000);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1310142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310142</guid><dc:creator><![CDATA[vampir26]]></dc:creator><pubDate>Wed, 20 Jun 2007 17:47:31 GMT</pubDate></item><item><title><![CDATA[Reply to GetRValue(); Problem on Wed, 20 Jun 2007 18:31:38 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">(...)
// if(hWnd = NULL) // &lt;- Zuweisung
 if(hWnd == NULL)  // &lt;- Vergleich
(...)
// if(hDC = NULL)  // &lt;- Zuweisung
 if(hDC == NULL)   // &lt;- Vergleich
(...)
</code></pre>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310162</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 20 Jun 2007 18:31:38 GMT</pubDate></item><item><title><![CDATA[Reply to GetRValue(); Problem on Wed, 20 Jun 2007 19:13:10 GMT]]></title><description><![CDATA[<p>Oh man! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Danke.<br />
Ich hab so ziemlich alles überprüft, aber nicht DAS.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310177</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310177</guid><dc:creator><![CDATA[vampir26]]></dc:creator><pubDate>Wed, 20 Jun 2007 19:13:10 GMT</pubDate></item></channel></rss>