<?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[Bitmaps auf DC blitten und dann gesamten DC Inhalt in Bitmap schreiben...]]></title><description><![CDATA[<p>Hallo!</p>
<p>Langer Titel, ich weiß <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=";)"
      alt="😉"
    /></p>
<p>Also, ich möchte ein paar Bitmaps auf ein HDC blitten, so dass sie im Fenster angezeigt werden. Das funktioniert auch wunderbar. Jetzt würde ich aber gerne den Inhalt des DCs nach dem BitBlt Vorgang in ein HBITMAP speichern.</p>
<p>Bis jetzt habe ich folgenden Code:</p>
<pre><code class="language-cpp">HDC hdc= GetDC(hWnd);
HDC hBitmapDC= CreateCompatibleDC(hdc);
HBITMAP SrcBmp;

SrcBmp= CreateCompatibleBitmap(hdc,1024,1024);
SelectObject(hBitmapDC,SrcBmp);
BitBlt(hBitmapDC,0,0,1024,1024,hdc,0,0,SRCCOPY);
</code></pre>
<p>Das Programm zeichnet beim Start ein Raster per LineTo(). Dieses Raster wird ohne Probleme mit dem o.g. Code in eine Bitmap gespeichert, doch sobald ich die Bitmaps in das DC blitte und den ganzen Kram aus dem DC dann in ein Bitmap schreiben will, bekomme ich als Ergebnis eine schwarze Fläche.</p>
<p>Weiß jemand, wie ich das DC mit dem dort hinein geblitteten Inhalt in ein HBITMAP schreiben kann?</p>
<p>Gruß veryxRV</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/182728/bitmaps-auf-dc-blitten-und-dann-gesamten-dc-inhalt-in-bitmap-schreiben</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 08:38:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182728.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 May 2007 15:38:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmaps auf DC blitten und dann gesamten DC Inhalt in Bitmap schreiben... on Mon, 28 May 2007 15:38:39 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Langer Titel, ich weiß <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=";)"
      alt="😉"
    /></p>
<p>Also, ich möchte ein paar Bitmaps auf ein HDC blitten, so dass sie im Fenster angezeigt werden. Das funktioniert auch wunderbar. Jetzt würde ich aber gerne den Inhalt des DCs nach dem BitBlt Vorgang in ein HBITMAP speichern.</p>
<p>Bis jetzt habe ich folgenden Code:</p>
<pre><code class="language-cpp">HDC hdc= GetDC(hWnd);
HDC hBitmapDC= CreateCompatibleDC(hdc);
HBITMAP SrcBmp;

SrcBmp= CreateCompatibleBitmap(hdc,1024,1024);
SelectObject(hBitmapDC,SrcBmp);
BitBlt(hBitmapDC,0,0,1024,1024,hdc,0,0,SRCCOPY);
</code></pre>
<p>Das Programm zeichnet beim Start ein Raster per LineTo(). Dieses Raster wird ohne Probleme mit dem o.g. Code in eine Bitmap gespeichert, doch sobald ich die Bitmaps in das DC blitte und den ganzen Kram aus dem DC dann in ein Bitmap schreiben will, bekomme ich als Ergebnis eine schwarze Fläche.</p>
<p>Weiß jemand, wie ich das DC mit dem dort hinein geblitteten Inhalt in ein HBITMAP schreiben kann?</p>
<p>Gruß veryxRV</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293860</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Mon, 28 May 2007 15:38:39 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmaps auf DC blitten und dann gesamten DC Inhalt in Bitmap schreiben... on Mon, 28 May 2007 16:05:11 GMT]]></title><description><![CDATA[<p>Hallo veryxRV!</p>
<p>Dein Code funktioniert doch, was willst du eigentlich?</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293885</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Mon, 28 May 2007 16:05:11 GMT</pubDate></item></channel></rss>