<?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[[GDI] Handle auf DIB]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab eine Frage zu DIBs. Ich habe eine BITMAPINFO und eine Zeiger auf die Daten des DIB. Ich will das Bitmap über die GDI bearbeiten. Um es an einen Gerätekontext zu binden (SelectObject), benötige ich ein HBITMAP.</p>
<p>Wie erzeuge ich das HBITMAP eines DIB? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Im MSDN habe ich 2 Methoden gefunden, wobei ich mir nicht sicher bin, ob es zu meinem Problem passt:</p>
<blockquote>
<p>CreateDIBitmap()<br />
The CreateDIBitmap function creates a compatible bitmap (DDB) from a DIB and, optionally, sets the bitmap bits.</p>
<p>CreateDIBSection()<br />
The CreateDIBSection function creates a DIB that applications can write to directly. The function gives you a pointer to the location of the bitmap bit values. You can supply a handle to a file-mapping object that the function will use to create the bitmap, or you can let the system allocate the memory for the bitmap.</p>
</blockquote>
<p>Die erste Fkt. erzeugt ein HBITMAP, nimmt die gegebene pBits auf, aber macht daraus ein DDB.<br />
Die zweite gibt mir ein HBITMAP auf ein DIB (das will ich), aber ich bekomme die pBits nicht mit unter, sodass ich sie erst rüberkopieren müsste. Diesen Ansatz werde ich erstmal umsetzen.</p>
<p>Gibt es noch eine andere Möglichkeit?</p>
<p>Danke,<br />
don_basto.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/140617/gdi-handle-auf-dib</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 12:34:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/140617.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Mar 2006 09:00:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [GDI] Handle auf DIB on Thu, 16 Mar 2006 09:00:31 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab eine Frage zu DIBs. Ich habe eine BITMAPINFO und eine Zeiger auf die Daten des DIB. Ich will das Bitmap über die GDI bearbeiten. Um es an einen Gerätekontext zu binden (SelectObject), benötige ich ein HBITMAP.</p>
<p>Wie erzeuge ich das HBITMAP eines DIB? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Im MSDN habe ich 2 Methoden gefunden, wobei ich mir nicht sicher bin, ob es zu meinem Problem passt:</p>
<blockquote>
<p>CreateDIBitmap()<br />
The CreateDIBitmap function creates a compatible bitmap (DDB) from a DIB and, optionally, sets the bitmap bits.</p>
<p>CreateDIBSection()<br />
The CreateDIBSection function creates a DIB that applications can write to directly. The function gives you a pointer to the location of the bitmap bit values. You can supply a handle to a file-mapping object that the function will use to create the bitmap, or you can let the system allocate the memory for the bitmap.</p>
</blockquote>
<p>Die erste Fkt. erzeugt ein HBITMAP, nimmt die gegebene pBits auf, aber macht daraus ein DDB.<br />
Die zweite gibt mir ein HBITMAP auf ein DIB (das will ich), aber ich bekomme die pBits nicht mit unter, sodass ich sie erst rüberkopieren müsste. Diesen Ansatz werde ich erstmal umsetzen.</p>
<p>Gibt es noch eine andere Möglichkeit?</p>
<p>Danke,<br />
don_basto.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017302</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Thu, 16 Mar 2006 09:00:31 GMT</pubDate></item></channel></rss>