<?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[Ausgabe am Bildschirm SetPixel vs. BitBlt]]></title><description><![CDATA[<p>Hi Leute!<br />
Wenn ich den nachfolgenden Code in das WM_PAINT-Nachrichtenereignis eintrage<br />
wird durch Bereich 1 eine blaue Fläche, durch Bereich 2 aber eine rote Fläche erzeugt.<br />
Vertauscht Windows hier einfach die Rot- und Blau-Werte?</p>
<pre><code>[cpp]
HDC hdc;

hdc = BeginPaint(hwnd, &amp;ps);

COLORREF Display[1024][768];

// Bereich 1
//----------
for(int i = 0; i &lt; 1024; i++)
{
	for(int j = 0; j &lt; 768; j++)
	{
		SetPixel(hdc, i, j, 0x00FF0000);
	}
}
// Bereich 1 Ende

// Bereich 2
//----------
HDC hMemDC;
HBITMAP hBitmap;

for(int i = 0; i &lt; 1024; i++)
{
	for(int j = 0; j &lt; 768; j++)
	{
		Display[i][j] = 0x00FF0000;
	}
}

hBitmap = CreateBitmap(1024, 768, 1, 32, &amp;Display);
hMemDC = CreateCompatibleDC(hdc);
SelectObject(hMemDC, hBitmap);
BitBlt(hdc, 0, 0, 1024, 768, hMemDC, 0, 0, SRCCOPY);
// Bereich 2 Ende

EndPaint(hwnd, &amp;ps);
[/cpp]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/124109/ausgabe-am-bildschirm-setpixel-vs-bitblt</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 05:07:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124109.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Oct 2005 22:19:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ausgabe am Bildschirm SetPixel vs. BitBlt on Sun, 23 Oct 2005 22:19:09 GMT]]></title><description><![CDATA[<p>Hi Leute!<br />
Wenn ich den nachfolgenden Code in das WM_PAINT-Nachrichtenereignis eintrage<br />
wird durch Bereich 1 eine blaue Fläche, durch Bereich 2 aber eine rote Fläche erzeugt.<br />
Vertauscht Windows hier einfach die Rot- und Blau-Werte?</p>
<pre><code>[cpp]
HDC hdc;

hdc = BeginPaint(hwnd, &amp;ps);

COLORREF Display[1024][768];

// Bereich 1
//----------
for(int i = 0; i &lt; 1024; i++)
{
	for(int j = 0; j &lt; 768; j++)
	{
		SetPixel(hdc, i, j, 0x00FF0000);
	}
}
// Bereich 1 Ende

// Bereich 2
//----------
HDC hMemDC;
HBITMAP hBitmap;

for(int i = 0; i &lt; 1024; i++)
{
	for(int j = 0; j &lt; 768; j++)
	{
		Display[i][j] = 0x00FF0000;
	}
}

hBitmap = CreateBitmap(1024, 768, 1, 32, &amp;Display);
hMemDC = CreateCompatibleDC(hdc);
SelectObject(hMemDC, hBitmap);
BitBlt(hdc, 0, 0, 1024, 768, hMemDC, 0, 0, SRCCOPY);
// Bereich 2 Ende

EndPaint(hwnd, &amp;ps);
[/cpp]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/899658</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899658</guid><dc:creator><![CDATA[Hoba]]></dc:creator><pubDate>Sun, 23 Oct 2005 22:19:09 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe am Bildschirm SetPixel vs. BitBlt on Sun, 23 Oct 2005 22:30:17 GMT]]></title><description><![CDATA[<p>SetPixel will eine COLORREF-Struktur, die ist so definiert:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/colors_9xiq.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/colors_9xiq.asp</a><br />
Da kommt also zuerst blau dran <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /></p>
<p>Man kann da auch prima das RGB-Makro benutzen:<br />
SetPixel(hdc, i, j, RGB(255,0,0));</p>
]]></description><link>https://www.c-plusplus.net/forum/post/899662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899662</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 23 Oct 2005 22:30:17 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe am Bildschirm SetPixel vs. BitBlt on Sun, 23 Oct 2005 23:17:06 GMT]]></title><description><![CDATA[<p>EDIT: (Hatte übersehen, dass du 32 Bit Farbtiefe verwendet hast, deswegen waren meine Aussagen diesbezüglich fehlerhaft.</p>
<p>CreateBitmap erwartet als Pixeldaten ein Array aus RGBQUAD-Strukturen und nicht COLORREFs. Außerdem müssen die Pixeldaten auf 32Bit ausgerichtet sein, was aber bei deiner Farbtiefe von 32 Bit ja immer der Fall ist ohne besondere Vorkehrungen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/899668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899668</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Sun, 23 Oct 2005 23:17:06 GMT</pubDate></item></channel></rss>