<?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 CDC kopieren]]></title><description><![CDATA[<p>Hei,<br />
wie kopiert man doch gleich den Inhalt eines HDCs in ein CDC? Hatte es mit BitBlt vor aber das geht nicht.</p>
<p>Also?</p>
<p>Danke,<br />
Michael</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/165433/hdc-in-cdc-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 13:00:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/165433.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Nov 2006 20:39:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HDC in CDC kopieren on Sun, 19 Nov 2006 20:39:24 GMT]]></title><description><![CDATA[<p>Hei,<br />
wie kopiert man doch gleich den Inhalt eines HDCs in ein CDC? Hatte es mit BitBlt vor aber das geht nicht.</p>
<p>Also?</p>
<p>Danke,<br />
Michael</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177414</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177414</guid><dc:creator><![CDATA[Hecker.Michael]]></dc:creator><pubDate>Sun, 19 Nov 2006 20:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to HDC in CDC kopieren on Sun, 19 Nov 2006 20:46:15 GMT]]></title><description><![CDATA[<p>Noch schnell zur Erklärung:</p>
<pre><code class="language-cpp">int src_width	=	GetSystemMetrics(SM_CXSCREEN);
		int src_height	=	GetSystemMetrics(SM_CYSCREEN);

		HWND    hWnd    = ::GetDesktopWindow();
		HDC     hdc     = ::GetDC(hWnd);
		HDC     memDC   = ::CreateCompatibleDC(hdc);
		HBITMAP hbm     = ::CreateCompatibleBitmap(hdc, src_width, src_height);
		HBITMAP hbmOld  = (HBITMAP)::SelectObject(memDC, hbm);

		BitBlt(dc, 0, 0, src_width, src_height, hdc, 0, 0, SRCCOPY);
</code></pre>
<p>Nur das der Inhalt nicht direkt auf dc ausgegeben werden soll, sondern auf das CDC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177419</guid><dc:creator><![CDATA[Hecker.Michael]]></dc:creator><pubDate>Sun, 19 Nov 2006 20:46:15 GMT</pubDate></item><item><title><![CDATA[Reply to HDC in CDC kopieren on Sun, 19 Nov 2006 21:22:53 GMT]]></title><description><![CDATA[<p>Wie wäre es sinnvollerweise gleich komplett mit MFC:</p>
<pre><code class="language-cpp">CDC* pDC = CWnd::GetDesktopWindow()-&gt;GetDC();
CDC memDC;
memDC.CreateCompatibleDC(pDC);

CBitmap Bitmap;
Bitmap.CreateCompatibleBitmap(pDC, src_width, src_height);

CBitmap* pOldBitmap = memDC.SelectObject(&amp;Bitmap);

// Und was auch immer du dann machen willst!
</code></pre>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177442</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 19 Nov 2006 21:22:53 GMT</pubDate></item><item><title><![CDATA[Reply to HDC in CDC kopieren on Sun, 19 Nov 2006 21:30:21 GMT]]></title><description><![CDATA[<p>VIELEN DANK!</p>
<p>Habe eine Sekunde bevor du geschrieben hast auch<br />
src_dc.FromHandle(hdc);<br />
gefunden, falls es mal wieder jemand braucht.</p>
<p>Grüße,<br />
Michael</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1177447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1177447</guid><dc:creator><![CDATA[Hecker.Michael]]></dc:creator><pubDate>Sun, 19 Nov 2006 21:30:21 GMT</pubDate></item></channel></rss>