<?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 funktioniert nicht?]]></title><description><![CDATA[<p>Ich hab ein anderes Fenster und möchte dort den Farbverlauf eines Teils des Fensters überwachen. Ich suche speziell nach einer bestimmten Farbe, hier eine vereinfachte Darstellung die im ganzen Fenster nach der Farbe suchen soll (funktioniert leider auch nicht).</p>
<pre><code class="language-cpp">HWND wnd = FindWindow(&quot;Klassenname&quot;,0); // Funktioniert noch

RECT size;
GetClientRect(wnd,&amp;size); // Größe des Fensters bestimmen

HDC dc = GetWindowDC(wnd);
while(true)
{
	bool found = false;
	int x = 0;
	int y = 0;

	for(;x &lt; size.right &amp;&amp; !found; ++x)
		for(;y &lt; size.bottom &amp;&amp; !found; ++y)
		{
			COLORREF now = GetPixel(dc,x,y);
			if(now == RGB(183,77,87))
				found = true;
			else // DEBUG
				cout &lt;&lt; now &lt;&lt; endl;
		}

	if(found)
		// soweit kommts nie
}
ReleaseDC(wnd,dc);
</code></pre>
<p>Allerdings ist now bloß eine Zahl die für mich absolut keine Bedeutung hat - sie ist auch != CLR_INVALID.</p>
<p>Was mach ich falsch? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/91355/getpixel-funktioniert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 10:19:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/91355.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Nov 2004 20:11:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Sun, 07 Nov 2004 20:11:26 GMT]]></title><description><![CDATA[<p>Ich hab ein anderes Fenster und möchte dort den Farbverlauf eines Teils des Fensters überwachen. Ich suche speziell nach einer bestimmten Farbe, hier eine vereinfachte Darstellung die im ganzen Fenster nach der Farbe suchen soll (funktioniert leider auch nicht).</p>
<pre><code class="language-cpp">HWND wnd = FindWindow(&quot;Klassenname&quot;,0); // Funktioniert noch

RECT size;
GetClientRect(wnd,&amp;size); // Größe des Fensters bestimmen

HDC dc = GetWindowDC(wnd);
while(true)
{
	bool found = false;
	int x = 0;
	int y = 0;

	for(;x &lt; size.right &amp;&amp; !found; ++x)
		for(;y &lt; size.bottom &amp;&amp; !found; ++y)
		{
			COLORREF now = GetPixel(dc,x,y);
			if(now == RGB(183,77,87))
				found = true;
			else // DEBUG
				cout &lt;&lt; now &lt;&lt; endl;
		}

	if(found)
		// soweit kommts nie
}
ReleaseDC(wnd,dc);
</code></pre>
<p>Allerdings ist now bloß eine Zahl die für mich absolut keine Bedeutung hat - sie ist auch != CLR_INVALID.</p>
<p>Was mach ich falsch? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/646930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/646930</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Sun, 07 Nov 2004 20:11:26 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Sun, 07 Nov 2004 20:23:42 GMT]]></title><description><![CDATA[<p>Mit GetRValue(), GetGValue() und GetBValue() kannste dir den Farbwert aus dem COLORREF holen. Vielleicht kommt die Farbe aufgrund von irgendwelcher Farbkorrektur , die Windows evtl. durchführt gar nicht vor...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/646935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/646935</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 07 Nov 2004 20:23:42 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Mon, 08 Nov 2004 21:31:25 GMT]]></title><description><![CDATA[<p>Du kannst ja mal SetPixel statt GetPixel verwenden. Dann siehst du auch genau welche Pixel er durchsucht (und ob es das richtige Fenster ist).</p>
<p>Ist das Fenster transparent (also so leicht durchsichtig)?</p>
<p>Btw:</p>
<blockquote>
<p>Allerdings ist now bloß eine Zahl die für mich absolut keine Bedeutung hat...</p>
</blockquote>
<p>Hä?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/647784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/647784</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Mon, 08 Nov 2004 21:31:25 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Mon, 08 Nov 2004 21:35:34 GMT]]></title><description><![CDATA[<p>1. Ja werde ich machen - denkst du es könnte ein Problem sein, dass das Programm in der Win-Flash-Umgebung läuft? Also das Programm ein Flash-Programm ist?</p>
<p>2. Der Wert der Variable now hat für mich keine Bedeutung</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/647789</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/647789</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Mon, 08 Nov 2004 21:35:34 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Mon, 08 Nov 2004 21:44:22 GMT]]></title><description><![CDATA[<p>Du könntest ja mal nach deiner Methode einfach alle Pixel in ein zweites Fenster kopieren, dann siehst du auch gleich, was er ausliest <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/647796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/647796</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 08 Nov 2004 21:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Thu, 11 Nov 2004 16:28:02 GMT]]></title><description><![CDATA[<p>Das seh ich so auch - lauter blödsinn und Werte die keine Farben sind <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/649609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/649609</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Thu, 11 Nov 2004 16:28:02 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Thu, 11 Nov 2004 16:31:06 GMT]]></title><description><![CDATA[<p>GetRValue(), GetGValue() und GetBValue()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/649614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/649614</guid><dc:creator><![CDATA[wiederholung]]></dc:creator><pubDate>Thu, 11 Nov 2004 16:31:06 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Thu, 11 Nov 2004 17:06:53 GMT]]></title><description><![CDATA[<p>Wie kommst du darauf, dass es keine Farbe ist? Hast du dir mal angeschaut, was das Macro RGB macht? D.h. es kommen schön große Zahlen raus ... Dass es dir nix sagt hat nix zu bedeuten <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/649641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/649641</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 11 Nov 2004 17:06:53 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel funktioniert nicht? on Thu, 11 Nov 2004 17:19:55 GMT]]></title><description><![CDATA[<p>Habs mal etwas modifiziert:</p>
<pre><code class="language-cpp">HWND wnd = FindWindow(&quot;Klassenname&quot;,0); // Funktioniert noch

RECT size;
COLORREF now;
HDC hdc;
char debugtext[300];

GetClientRect(wnd,&amp;size); // Größe des Fensters bestimmen

hdc = GetWindowDC(wnd);
while(true)
{
    bool found = false;
    int x = 0;
    int y = 0;

    for(;x &lt; size.right &amp;&amp; !found; ++x)
        for(;y &lt; size.bottom &amp;&amp; !found; ++y)
        {
            COLORREF now = GetPixel(hdc,x,y);
            if(now == RGB(183,77,87))
            {
                found = true;
            }
            else
            {
               wsprintf(debugtext,&quot;Farbe an Position %ix%i ist RGB(%i|%i|%i) \n&quot;,x,y,GetRValue(now),GetGValue(now),GetBValue(now));
               OutputDebugString(debugtext);
            }
        }
}
ReleaseDC(wnd,dc);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/649647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/649647</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Thu, 11 Nov 2004 17:19:55 GMT</pubDate></item></channel></rss>