<?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[DIB - section von 24 bit nach 8 bit konvertieren]]></title><description><![CDATA[<p>Tjo, das ist schon meine Frage, wie gehts am einfachsten ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/86750/dib-section-von-24-bit-nach-8-bit-konvertieren</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 18:30:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/86750.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Sep 2004 08:54:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DIB - section von 24 bit nach 8 bit konvertieren on Wed, 22 Sep 2004 08:54:55 GMT]]></title><description><![CDATA[<p>Tjo, das ist schon meine Frage, wie gehts am einfachsten ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/612630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/612630</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Wed, 22 Sep 2004 08:54:55 GMT</pubDate></item><item><title><![CDATA[Reply to DIB - section von 24 bit nach 8 bit konvertieren on Wed, 22 Sep 2004 11:02:34 GMT]]></title><description><![CDATA[<p>soll das ding ne eigene farb-palette miterstellen?<br />
Ansonsten einfach ne 8bit dib erzeugen, beide in nen DC selectieren und die 24bit in die 8bit bliten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/612780</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/612780</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Wed, 22 Sep 2004 11:02:34 GMT</pubDate></item><item><title><![CDATA[Reply to DIB - section von 24 bit nach 8 bit konvertieren on Thu, 23 Sep 2004 06:34:43 GMT]]></title><description><![CDATA[<p>hmm.. etwas weiter ausführen kannste das nicht ?<br />
Wie erzeuge ich denn die DIB ohne, dass ich Daten drin hab ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/613328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/613328</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Thu, 23 Sep 2004 06:34:43 GMT</pubDate></item><item><title><![CDATA[Reply to DIB - section von 24 bit nach 8 bit konvertieren on Thu, 23 Sep 2004 09:53:07 GMT]]></title><description><![CDATA[<p>Mit CreateDIBSection.</p>
<p>bsp:</p>
<pre><code class="language-cpp">HBITMAP DIB24toDIB8(HBITMAP hBmp24, int cx, int cy)
{
   BITMAPINFO bmInfo8;
   memset(&amp;bmInfo8,0,sizeof(BITMAPINFO));
   bmInfo8.bmiHeader.biSize	= sizeof(BITMAPINFOHEADER);
   bmInfo8.bmiHeader.biWidth	= cx;
   bmInfo8.bmiHeader.biHeight	= cy;
   bmInfo8.bmiHeader.biPlanes	= 1;
   bmInfo8.bmiHeader.biBitCount	= 8;
   bmInfo8.bmiHeader.biCompression  = BI_RGB;
   // erzeuge eine 8 bit DIB
   BYTE *pBits8=NULL;
   HBITMAP hBitmap8 = CreateDIBSection(NULL,&amp;bmInfo8,DIB_RGB_COLORS,(void**)&amp;pBits8,NULL,0);

   // selectiere die 8 bit DIB in einen DC
   HDC hDC8 = CreateCompatibleDC(NULL);
   HGDIOBJ hOldBmp8 = SelectObject(hDC8,hBitmap8);
   // selectiere die 24 bit DIB in nen DC
   HDC hDC24 = CreateCompatibleDC(hDC8);
   HGDIOBJ hOldBmp24 = SelectObject(hDC24,hBitmap24);

   // blite die DIB24 in die DIB8
   // windows macht die frabraum konvertierung für dich
   StretchBlt(hDC8,0,0,cx,cy,hDC24,0,0,cx,cy,SRCCOPY);

  // Aufräumen
  SelectObject(hDC24,hOldBmp24);
  SelectObject(hDC8,hOldBmp8);
  DeleteDC(hDC24);
  DeleteDC(hDC8);

  return hBitmap8;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/613516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/613516</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Thu, 23 Sep 2004 09:53:07 GMT</pubDate></item></channel></rss>