<?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[Memory DC schickt Bitmaps ins Nirvana]]></title><description><![CDATA[<p>Da sowohl Petzold als auch die Online-Dokumentation von MSVC++ aus Memory DC ein Geheimnis machen, hier meine völlig idiotische Frage:<br />
Warum gibt WM_PAINT nichts wieder? In WM_LBUTTONDOWN werden meine Rechtecke virtuell gezeichnet, gehen dann aber auf der langen Reise nach WM_PAINT verloren.</p>
<p>case WM_LBUTTONDOWN:<br />
hdc=GetDC(hWnd);<br />
hdcMem= CreateCompatibleDC (hdc);<br />
memBM=CreateCompatibleBitmap (hdc,cxClient,cyClient);<br />
SelectObject(hdcMem, memBM);<br />
rechteck(hdcMem, cxClient, cyClient, sooft);<br />
ReleaseDC(hWnd, hdc);<br />
break;</p>
<p>(...)</p>
<p>case WM_PAINT:<br />
hdc = BeginPaint(hWnd, &amp;ps);<br />
BitBlt(hdc, 0, 0, cxClient, cyClient, hdcMem, 0, 0, SRCCOPY);<br />
EndPaint(hWnd, &amp;ps);<br />
break;</p>
<p>Ich weiß, dass ich ganz bestimmt einen ganz groben Fehler begangen habe. Wurde aber aus Petzold &amp; Co. kein bisschen schlauer.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148234/memory-dc-schickt-bitmaps-ins-nirvana</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 06:05:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148234.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 May 2006 14:57:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 14:57:56 GMT]]></title><description><![CDATA[<p>Da sowohl Petzold als auch die Online-Dokumentation von MSVC++ aus Memory DC ein Geheimnis machen, hier meine völlig idiotische Frage:<br />
Warum gibt WM_PAINT nichts wieder? In WM_LBUTTONDOWN werden meine Rechtecke virtuell gezeichnet, gehen dann aber auf der langen Reise nach WM_PAINT verloren.</p>
<p>case WM_LBUTTONDOWN:<br />
hdc=GetDC(hWnd);<br />
hdcMem= CreateCompatibleDC (hdc);<br />
memBM=CreateCompatibleBitmap (hdc,cxClient,cyClient);<br />
SelectObject(hdcMem, memBM);<br />
rechteck(hdcMem, cxClient, cyClient, sooft);<br />
ReleaseDC(hWnd, hdc);<br />
break;</p>
<p>(...)</p>
<p>case WM_PAINT:<br />
hdc = BeginPaint(hWnd, &amp;ps);<br />
BitBlt(hdc, 0, 0, cxClient, cyClient, hdcMem, 0, 0, SRCCOPY);<br />
EndPaint(hWnd, &amp;ps);<br />
break;</p>
<p>Ich weiß, dass ich ganz bestimmt einen ganz groben Fehler begangen habe. Wurde aber aus Petzold &amp; Co. kein bisschen schlauer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064343</guid><dc:creator><![CDATA[Alexander Rahm]]></dc:creator><pubDate>Wed, 24 May 2006 14:57:56 GMT</pubDate></item><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 15:18:12 GMT]]></title><description><![CDATA[<p>Alexander Rahm schrieb:</p>
<blockquote>
<pre><code>case WM_LBUTTONDOWN:
	hdc=GetDC(hWnd);
	hdcMem= CreateCompatibleDC (hdc);
	memBM=CreateCompatibleBitmap (hdc,cxClient,cyClient);
	SelectObject(hdcMem, memBM);
	rechteck(hdcMem, cxClient, cyClient, sooft);
	ReleaseDC(hWnd, hdc);
	break;
</code></pre>
</blockquote>
<p>probier mal so ähnlich...</p>
<pre><code>case WM_LBUTTONDOWN:
{
   static BOOL flag = FALSE;
   if (flag == FALSE)
   { 
      flag = TRUE;
      hdc=GetDC(hWnd);
      hdcMem= CreateCompatibleDC (hdc);
      memBM=CreateCompatibleBitmap (hdc,cxClient,cyClient);
      SelectObject(hdcMem, memBM);
      ReleaseDC(hWnd, hdc);
   }
   rechteck(hdcMem, cxClient, cyClient, sooft);
}
break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1064358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064358</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Wed, 24 May 2006 15:18:12 GMT</pubDate></item><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 15:24:18 GMT]]></title><description><![CDATA[<p>Ich glaube das Erstellen des Memory DCs gehört eher nach WM_SIZE.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064365</guid><dc:creator><![CDATA[glaube]]></dc:creator><pubDate>Wed, 24 May 2006 15:24:18 GMT</pubDate></item><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 15:35:11 GMT]]></title><description><![CDATA[<p>glaube schrieb:</p>
<blockquote>
<p>Ich glaube das Erstellen des Memory DCs gehört eher nach WM_SIZE.</p>
</blockquote>
<p>wenn schon, dann zu WM_CREATE oder alles was man sonst noch als 'konstruktor' missbrauchen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064378</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064378</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Wed, 24 May 2006 15:35:11 GMT</pubDate></item><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 16:48:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/3162">@net</a>:<br />
ändert nichts, Bitmap wird nicht ausgegeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064427</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064427</guid><dc:creator><![CDATA[Alexander Rahm]]></dc:creator><pubDate>Wed, 24 May 2006 16:48:31 GMT</pubDate></item><item><title><![CDATA[Reply to Memory DC schickt Bitmaps ins Nirvana on Wed, 24 May 2006 17:16:18 GMT]]></title><description><![CDATA[<p>Alexander Rahm schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/3162">@net</a>:<br />
ändert nichts, Bitmap wird nicht ausgegeben.</p>
</blockquote>
<p>na dann geh mit'm debugger rein und guck dir vor allem die rückgabewerte der createcompatibleBlah...-funktionen an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064445</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Wed, 24 May 2006 17:16:18 GMT</pubDate></item></channel></rss>