<?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 will nicht funktionieren]]></title><description><![CDATA[<p>ich versuche über einen memory dc flimmerfrei auf den dc meines controls (von CWnd abgeleitet) zu zeichnen:</p>
<pre><code class="language-cpp">void CMyClass::OnPaint() 
{
	CRect rRect;
	CClientDC cClientDC(this);
	CDC dMemDC;

	dMemDC.CreateCompatibleDC(&amp;cClientDC);

	GetClientRect(rRect);

	dMemDC.FillSolidRect(rRect, RGB(200,0,0));

	cClientDC.BitBlt(0, 0, rRect.Width(), rRect.Height(), &amp;dMemDC, 0, 0, SRCCOPY);
}
</code></pre>
<p>aber es tut sich nichts. vermute es liegt an mir ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146510/memory-dc-will-nicht-funktionieren</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 14:54:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146510.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 May 2006 14:11:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 14:11:12 GMT]]></title><description><![CDATA[<p>ich versuche über einen memory dc flimmerfrei auf den dc meines controls (von CWnd abgeleitet) zu zeichnen:</p>
<pre><code class="language-cpp">void CMyClass::OnPaint() 
{
	CRect rRect;
	CClientDC cClientDC(this);
	CDC dMemDC;

	dMemDC.CreateCompatibleDC(&amp;cClientDC);

	GetClientRect(rRect);

	dMemDC.FillSolidRect(rRect, RGB(200,0,0));

	cClientDC.BitBlt(0, 0, rRect.Width(), rRect.Height(), &amp;dMemDC, 0, 0, SRCCOPY);
}
</code></pre>
<p>aber es tut sich nichts. vermute es liegt an mir ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053433</guid><dc:creator><![CDATA[Red Skall]]></dc:creator><pubDate>Mon, 08 May 2006 14:11:12 GMT</pubDate></item><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 15:05:13 GMT]]></title><description><![CDATA[<p>In der Behandlungsroutine für die WM_PAINT Botschaft ( CWnd::OnPaint() ) solltest du mit einem CPaintDC arbeiten und nicht mit einem CClientDC, damit BeginPaint und EndPaint korrekt aufgerufen werden.</p>
<pre><code class="language-cpp">void CMyClass::OnPaint()
{
    CRect rRect;
    CPaintDC cClientDC(this);
    CDC dMemDC;

    //-- Rest of the code
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1053494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053494</guid><dc:creator><![CDATA[tvdog]]></dc:creator><pubDate>Mon, 08 May 2006 15:05:13 GMT</pubDate></item><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 15:21:47 GMT]]></title><description><![CDATA[<p>mit dem CPaintDC klappts nicht. hatte das mit dem ClientDC zum testen gemacht.</p>
<p>hast du vielleicht noch eine andere idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053504</guid><dc:creator><![CDATA[Red Skall]]></dc:creator><pubDate>Mon, 08 May 2006 15:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 15:34:02 GMT]]></title><description><![CDATA[<p>Ich empfehle dir einfach das folgende zu nehmen und bei dir zu implementieren:<br />
<a href="http://www.codeproject.com/gdi/flickerfree.asp" rel="nofollow">http://www.codeproject.com/gdi/flickerfree.asp</a></p>
<p>Ist alles vorgefertigt und schön beschrieben und funktioniert!<br />
Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053516</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 08 May 2006 15:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 15:43:54 GMT]]></title><description><![CDATA[<p>Ein DC hat standardmässig eine 1x1 pixel Bitmap selektiert. In der zeichnest du zur Zeit rum.</p>
<p>Da musst du noch eine Bitmap erstellen, diese in den MemDC selektieren, in dieser zeichnen und dann das Ergebnis blitten.</p>
<p>Etwa wie folgt: ( Mal ohne richtiges Fehlerhandling )</p>
<pre><code class="language-cpp">void CMyClass::OnPaint()
{
    CRect rRect;
    CPaintDC cClientDC(this);
    CDC dMemDC;
    GetClientRect(rRect);

    dMemDC.CreateCompatibleDC(&amp;cClientDC);
    CBitmap bmp;
    bmp.CreateCompatibleBitmap( &amp;cClientDC, rRect.Width(), rRect.Height() );
    CBitmap* oldbmp = dMemDC.SelectObject( &amp;bmp );

    dMemDC.FillSolidRect(rRect, RGB(200,0,0));

    cClientDC.BitBlt(0, 0, rRect.Width(), rRect.Height(), &amp;dMemDC, 0, 0, SRCCOPY);

    dMemDC.SelectObject( oldbmp );
    bmp.DeleteObject();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1053526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053526</guid><dc:creator><![CDATA[tvdog]]></dc:creator><pubDate>Mon, 08 May 2006 15:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to memory dc will nicht funktionieren on Mon, 08 May 2006 17:36:42 GMT]]></title><description><![CDATA[<p>asooo ist das. jetzt ist mir alles klar !! danke euch.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9752">@Dravere</a>: das sample ist glaube ich richtig gut !! probiere es später aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053634</guid><dc:creator><![CDATA[Red Skall]]></dc:creator><pubDate>Mon, 08 May 2006 17:36:42 GMT</pubDate></item></channel></rss>