<?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]]></title><description><![CDATA[<p>hallo,</p>
<p>zb.</p>
<p>ich bin in einen spiel<br />
und wenn ein bestimmter punkt (x und y coords habe ich) zb blau wird oder ist<br />
dann soll er meinen code ausführen nur ich weiß nicht wie das geht<br />
hab mir GetPixel angeschaut aber veersteh es nicht</p>
<p>mfG,<br />
help me</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158607/getpixel</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 01:32:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158607.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Sep 2006 20:26:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetPixel on Wed, 06 Sep 2006 20:26:46 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>zb.</p>
<p>ich bin in einen spiel<br />
und wenn ein bestimmter punkt (x und y coords habe ich) zb blau wird oder ist<br />
dann soll er meinen code ausführen nur ich weiß nicht wie das geht<br />
hab mir GetPixel angeschaut aber veersteh es nicht</p>
<p>mfG,<br />
help me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1132631</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1132631</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Wed, 06 Sep 2006 20:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Wed, 06 Sep 2006 20:33:31 GMT]]></title><description><![CDATA[<p>Help Me schrieb:</p>
<blockquote>
<p>[...]<br />
ich bin in einen spiel<br />
[...]</p>
</blockquote>
<p>N bissl konkreter wenn's geht...API-Basis ? OpenGL, DirectX, WinAPi( <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> ) ?</p>
<p>Hängt von der verwendetetn Grafikbibliothek ab.</p>
<p>in WinAPI gehts recht einfach, hier ein einfaches Beispiel:</p>
<pre><code class="language-cpp">// HDC holen:
HDC hdcDesktop = GetDC(GetDesktopWindow());
// Pixelfarbe ermitteln:
COLORREF crExtracted = GetPixel(hdcDesktop, X-Position, Y-Position); // Hier müssen natürlich korrekte Interger stehen...
// einzelne Farbwerte extrahieren, wenn nötig:
BYTE byRed, byGreen, byBlue;
byRed   = GetRValue(crExtracted);
byGreen = GetGValue(crExtracted);
byBlue  = GetBValue(crExtracted);
// HDC wieder freigeben:
ReleaseDC(hdcDesktop);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1132636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1132636</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 06 Sep 2006 20:33:31 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Wed, 06 Sep 2006 22:22:18 GMT]]></title><description><![CDATA[<p>also basis ist :</p>
<p>DirectX</p>
<p>mfG,<br />
help me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1132674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1132674</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Wed, 06 Sep 2006 22:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Thu, 07 Sep 2006 00:06:15 GMT]]></title><description><![CDATA[<p>sry für double post:</p>
<p>nochmal zu :</p>
<pre><code class="language-cpp">// HDC holen:
HDC hdcDesktop = GetDC(GetDesktopWindow());
// Pixelfarbe ermitteln:
COLORREF crExtracted = GetPixel(hdcDesktop, X-Position, Y-Position); // Hier müssen natürlich korrekte Interger stehen...
// einzelne Farbwerte extrahieren, wenn nötig:
BYTE byRed, byGreen, byBlue;
byRed   = GetRValue(crExtracted);
byGreen = GetGValue(crExtracted);
byBlue  = GetBValue(crExtracted);
// HDC wieder freigeben:
ReleaseDC(hdcDesktop);
</code></pre>
<p>wie kann ich da zb in nen file mit fopen usw... reinschreiben die :</p>
<p>Hex - Wert<br />
Dezimal - Wert</p>
<p>und dann zb vergleichen</p>
<p>if(GetPixel(x,y) == 0x000000) { printf(&quot;muh&quot;); }</p>
<p>ty for hilfe und daas mit DirectX vergessen</p>
<p>mfG,<br />
help me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1132687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1132687</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Thu, 07 Sep 2006 00:06:15 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Thu, 07 Sep 2006 13:06:19 GMT]]></title><description><![CDATA[<p>Wenns für DirectX ist, ist das hier das falsche Forum. Lass dich mal ins Spieleprogrammierungs-Forum verschieben.</p>
<p>Dann noch:</p>
<blockquote>
<p>wie kann ich da zb in nen file mit fopen usw... reinschreiben die :</p>
<p>Hex - Wert<br />
Dezimal - Wert</p>
</blockquote>
<p>Wo ist das problem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1133012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1133012</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 07 Sep 2006 13:06:19 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Thu, 14 Sep 2006 07:59:46 GMT]]></title><description><![CDATA[<p>Falls du es noch nicht hast:</p>
<pre><code class="language-cpp">HWND hwnd = NULL;
HDC hdc = GetDC(hwnd);

COLORREF farben = GetPixel(hdc,x,y);
int r = GetRValue(farben);
int g = GetGValue(farben);
int b = GetBValue(farben);
//so kannst du den farbwert bestimmen, glaub so war es
</code></pre>
<p>geht aber auch einfacher:</p>
<pre><code class="language-cpp">if(GetPixel(hdc,x,y) == RGB(r,g,b))
{
//mache etwas
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1137043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137043</guid><dc:creator><![CDATA[Gordon11111]]></dc:creator><pubDate>Thu, 14 Sep 2006 07:59:46 GMT</pubDate></item><item><title><![CDATA[Reply to GetPixel on Thu, 14 Sep 2006 08:32:06 GMT]]></title><description><![CDATA[<p>Gordon11111 schrieb:</p>
<blockquote>
<p>Falls du es noch nicht hast:</p>
<pre><code class="language-cpp">HWND hwnd = NULL;
HDC hdc = GetDC(hwnd);

COLORREF farben = GetPixel(hdc,x,y);
int r = GetRValue(farben);
int g = GetGValue(farben);
int b = GetBValue(farben);
//so kannst du den farbwert bestimmen, glaub so war es
</code></pre>
<p>geht aber auch einfacher:</p>
<pre><code class="language-cpp">if(GetPixel(hdc,x,y) == RGB(r,g,b))
{
//mache etwas
}
</code></pre>
</blockquote>
<p>Mir ging es um die Extrahierung der Farb-Komponenten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1137069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137069</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 14 Sep 2006 08:32:06 GMT</pubDate></item></channel></rss>