<?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[Frage zu GetPixel();]]></title><description><![CDATA[<p>Hallo,</p>
<p>The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.</p>
<p>COLORREF GetPixel(</p>
<p>HDC hdc, // handle of device context<br />
int XPos, // x-coordinate of pixel<br />
int nYPos // y-coordinate of pixel<br />
);</p>
<p>Parameters</p>
<p>hdc</p>
<p>Identifies the device context.</p>
<p>Wie bekomm ich den hdc von meinem Desktop?</p>
<p>Geht das mit CreateDC(); ?</p>
<p>The CreateDC function creates a device context (DC) for a device by using the specified name.</p>
<p>HDC CreateDC(</p>
<p>LPCTSTR lpszDriver, // pointer to string specifying driver name<br />
LPCTSTR lpszDevice, // pointer to string specifying device name<br />
LPCTSTR lpszOutput, // do not use; set to NULL<br />
CONST DEVMODE *lpInitData // pointer to optional printer data<br />
);</p>
<p>Und wenn ja was für einen Treiber Namen muss ich dann da nehmen bei lpszDriver?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237269/frage-zu-getpixel</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 10:05:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237269.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Mar 2009 15:06:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu GetPixel(); on Thu, 26 Mar 2009 15:06:10 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.</p>
<p>COLORREF GetPixel(</p>
<p>HDC hdc, // handle of device context<br />
int XPos, // x-coordinate of pixel<br />
int nYPos // y-coordinate of pixel<br />
);</p>
<p>Parameters</p>
<p>hdc</p>
<p>Identifies the device context.</p>
<p>Wie bekomm ich den hdc von meinem Desktop?</p>
<p>Geht das mit CreateDC(); ?</p>
<p>The CreateDC function creates a device context (DC) for a device by using the specified name.</p>
<p>HDC CreateDC(</p>
<p>LPCTSTR lpszDriver, // pointer to string specifying driver name<br />
LPCTSTR lpszDevice, // pointer to string specifying device name<br />
LPCTSTR lpszOutput, // do not use; set to NULL<br />
CONST DEVMODE *lpInitData // pointer to optional printer data<br />
);</p>
<p>Und wenn ja was für einen Treiber Namen muss ich dann da nehmen bei lpszDriver?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686396</guid><dc:creator><![CDATA[pix_el]]></dc:creator><pubDate>Thu, 26 Mar 2009 15:06:10 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu GetPixel(); on Thu, 26 Mar 2009 15:12:29 GMT]]></title><description><![CDATA[<p>Habs gerade gefunden ^^</p>
<p>Aber jetzt hab ich ein neues Problem <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>
<pre><code class="language-cpp">#include &lt;windows&gt;
#include &lt;iostream&gt;
using namespace std;

int main(int argc, char* argv[])
{

COLORREF farbe;
HDC desktop;

desktop = GetDC(0) ;
farbe = GetPixel(desktop, 100 , 100);

        if (farbe == CLR_INVALID)
        {
        cout&lt;&lt;&quot;error&quot;;
        }

        cout&lt;&lt; farbe &lt;&lt;endl;

return 0;
}
</code></pre>
<p>Aber wieso bekomme ich nicht den RGB Farb Wert was mach ich da 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>The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.</p>
<p>COLORREF GetPixel(</p>
<p>HDC hdc, // handle of device context<br />
int XPos, // x-coordinate of pixel<br />
int nYPos // y-coordinate of pixel<br />
);</p>
<p>Parameters</p>
<p>hdc</p>
<p>Identifies the device context.</p>
<p>nXPos</p>
<p>Specifies the logical x-coordinate of the pixel to be examined.</p>
<p>nYPos</p>
<p>Specifies the logical y-coordinate of the pixel to be examined.</p>
<p>Return Values</p>
<p>If the function succeeds, the return value is an RGB value. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.</p>
<p>Remarks</p>
<p>The pixel must be within the boundaries of the current clipping region.<br />
Not all devices support GetPixel. An application should call GetDeviceCaps to determine whether a specified device supports this function.</p>
<p>See Also</p>
<p>GetDeviceCaps, SetPixel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686402</guid><dc:creator><![CDATA[pix_el]]></dc:creator><pubDate>Thu, 26 Mar 2009 15:12:29 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu GetPixel(); on Thu, 26 Mar 2009 15:13:43 GMT]]></title><description><![CDATA[<p>Ach nochwas.</p>
<p>Das Programm gibt mir immer nur eine 0 aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686405</guid><dc:creator><![CDATA[pix_el]]></dc:creator><pubDate>Thu, 26 Mar 2009 15:13:43 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu GetPixel(); on Thu, 26 Mar 2009 15:23:13 GMT]]></title><description><![CDATA[<p>Jetzt funktioniert es auf einmal o_O mhhm.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686410</guid><dc:creator><![CDATA[pix_el]]></dc:creator><pubDate>Thu, 26 Mar 2009 15:23:13 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu GetPixel(); on Sun, 26 Apr 2009 23:05:58 GMT]]></title><description><![CDATA[<p>wieso bekommt es nie einer gebacken seine Lösung zu senden, wenn er nen Problem gelöst hat? ... &gt;_&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701758</guid><dc:creator><![CDATA[Jinyo]]></dc:creator><pubDate>Sun, 26 Apr 2009 23:05:58 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu GetPixel(); on Fri, 01 May 2009 13:02:23 GMT]]></title><description><![CDATA[<p>Ich habe mel eine Frage zu dem C++ Quellcode.</p>
<pre><code class="language-cpp">#include &lt;windows&gt;
#include &lt;iostream&gt;
using namespace std;

int main(int argc, char* argv[])
{

COLORREF farbe;
HDC desktop;

desktop = GetDC(0) ;
farbe = GetPixel(desktop, 100 , 100);

        if (farbe == CLR_INVALID)
        {
        cout&lt;&lt;&quot;error&quot;;
        }

        cout&lt;&lt; farbe &lt;&lt;endl;

return 0;
}
</code></pre>
<p>Wenn ich versuche das Programm nach dem kompilieren zu starten, bricht das programm mit einer Fehlermeldung ab. Kann mir einer sagen woran das liegen könnte <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>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704078</guid><dc:creator><![CDATA[??? !!!]]></dc:creator><pubDate>Fri, 01 May 2009 13:02:23 GMT</pubDate></item></channel></rss>