<?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[HDC in anderen HDC kopieren - wieso geht code nicht?]]></title><description><![CDATA[<p>Hallo!<br />
Wieso malt mir dieser Code einfach einen schwarzen Bereich auf meine Anwendung?</p>
<pre><code class="language-cpp">HDC test;
	HBITMAP htest;
	BITMAP btest;
    CPaintDC dc(this); // device context for painting

	test = CreateCompatibleDC(dc);

	TextOut(test, 0, 0, &quot;test&quot;, 20);

	htest = CreateCompatibleBitmap(test, GetDeviceCaps(test, HORZRES), 
        GetDeviceCaps(test, VERTRES));

	SelectObject(test, htest);

	GetObject(htest, sizeof(BITMAP), &amp;btest);

	BitBlt(dc, 0, 0, btest.bmWidth, btest.bmHeight, test, 0, 0, SRCCOPY);
</code></pre>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/51554/hdc-in-anderen-hdc-kopieren-wieso-geht-code-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sun, 31 May 2026 14:20:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/51554.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Oct 2003 09:51:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HDC in anderen HDC kopieren - wieso geht code nicht? on Sat, 11 Oct 2003 09:51:36 GMT]]></title><description><![CDATA[<p>Hallo!<br />
Wieso malt mir dieser Code einfach einen schwarzen Bereich auf meine Anwendung?</p>
<pre><code class="language-cpp">HDC test;
	HBITMAP htest;
	BITMAP btest;
    CPaintDC dc(this); // device context for painting

	test = CreateCompatibleDC(dc);

	TextOut(test, 0, 0, &quot;test&quot;, 20);

	htest = CreateCompatibleBitmap(test, GetDeviceCaps(test, HORZRES), 
        GetDeviceCaps(test, VERTRES));

	SelectObject(test, htest);

	GetObject(htest, sizeof(BITMAP), &amp;btest);

	BitBlt(dc, 0, 0, btest.bmWidth, btest.bmHeight, test, 0, 0, SRCCOPY);
</code></pre>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/370224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/370224</guid><dc:creator><![CDATA[Bitmap]]></dc:creator><pubDate>Sat, 11 Oct 2003 09:51:36 GMT</pubDate></item><item><title><![CDATA[Reply to HDC in anderen HDC kopieren - wieso geht code nicht? on Sat, 11 Oct 2003 10:53:50 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich hab den Code in eine Dialogbasierende Anwendung eingebaut aber bei mir ist überhaupt nichts passiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/370249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/370249</guid><dc:creator><![CDATA[Max M.]]></dc:creator><pubDate>Sat, 11 Oct 2003 10:53:50 GMT</pubDate></item><item><title><![CDATA[Reply to HDC in anderen HDC kopieren - wieso geht code nicht? on Sat, 11 Oct 2003 16:20:27 GMT]]></title><description><![CDATA[<p>Probiere mal so:</p>
<pre><code class="language-cpp">CRect Rect; GetClientRect(Rect);
CPaintDC* pDC = new CPaintDC(this);
CDC MemDC; MemDC.CreateCompatibleDC(pDC);
CBitmap Bitmap; Bitmap.CreateCompatibleBitmap(pDC,Rect.Width(),Rect.Height());

MemDC.SelectObject(&amp;Bitmap), MemDC.BitBlt(Rect.left,Rect.top,Rect.right,Rect.bottom,pDC,0,0,SRCCOPY);
MemDC.TextOut(5,5,CString(&quot;Hello World!&quot;)), pDC-&gt;BitBlt(Rect.left,Rect.top,Rect.right,Rect.bottom,&amp;MemDC,0,0,SRCCOPY);

MemDC.DeleteDC(), Bitmap.DeleteObject(); delete pDC;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/370421</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/370421</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Sat, 11 Oct 2003 16:20:27 GMT</pubDate></item></channel></rss>