<?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[Bitmap selbst gemacht - Geht nicht! - Warum?]]></title><description><![CDATA[<p>Tach zusammen!</p>
<p>Ich versuche ein Bitmap selbst zu bauen. Zu Testzwecken habe ich ein kleines Programm gebaut, dass mit ein &quot;unsinniges&quot; Bild erstellen soll.</p>
<pre><code class="language-cpp">int width         = 640;
   int height        = 480;
   int bytesPerPixel = 3;  // we need 24 bit (= 3x8 bit) for 24-Bit-RGB

   BITMAPFILEHEADER bmfh;
   BITMAPINFOHEADER bmih;
   BITMAPINFO bmi;
   BYTE *data = new BYTE[width*height*bytesPerPixel];

   bmfh.bfType       = 19778; // must be BM (or 19778 ASCII)
   bmfh.bfSize       = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + width*height*bytesPerPixel;
   bmfh.bfReserved1  = 0;
   bmfh.bfReserved2  = 0;
   bmfh.bfOffBits    = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);

   bmih.biSize          = sizeof(BITMAPINFOHEADER); // self size
   bmih.biWidth         = width;
   bmih.biHeight        = -height;  // negative to be a top-down-image
   bmih.biPlanes        = 1;  // must be 1
   bmih.biBitCount      = 8*bytesPerPixel; // we want a 24-bit-RGB-Image
   bmih.biCompression   = BI_RGB;   // uncompressed
   bmih.biSizeImage     = 0;  // because of BI_RGB in biCompression
   bmih.biXPelsPerMeter = 183; // pixels per meter? Microsoft's programmers ****!
   bmih.biYPelsPerMeter = 183; // pixels per meter? Microsoft's programmers ****!
   bmih.biClrUsed       = 0;  // unimportant for now
   bmih.biClrImportant  = 0;  // unimportant for now too

   bmi.bmiHeader        = bmih;
   //bmi.bmiColors        = 0;   // geht nicht!!!!!

   for(int index = 0; index &lt; height*width*bytesPerPixel; index++)
   {
      switch((index%3))
      {
         case 0: data[index] = 255; break; // Red; Image should be red
         case 1: data[index] = 0; break;   // Green; Image should be red
         case 2: data[index] = 0; break;   // Blue; Image should be red
      }

   }

   FILE *bmpFile = fopen(&quot;test.bmp&quot;, &quot;w+&quot;);  // open file
   if(bmpFile)
   {
      // write Bitmapfile
      fwrite(&amp;bmfh, sizeof(BITMAPFILEHEADER), 1, bmpFile);
      fwrite(&amp;bmi, sizeof(BITMAPINFO), 1, bmpFile);
      fwrite(data, width*height*bytesPerPixel, 1, bmpFile);

      fclose(bmpFile); // close file
   }
</code></pre>
<p>Beim öffnen der Datei in einem Grafikprogramm kommt die Meldung, dass das Dateiformat nicht bekannt sein. Windows zeigt auch keine Vorschau. Irgendwie ist das ganze Bild &quot;fritte&quot; und ich weiß nicht warum.</p>
<p>Hab auch mal ein rotes 24-Bit-RGB-Bitmap mit Paint erstellt (gleiche Grösse versteht sich). Im Editor vergleichen sehen beide Bilder fast identisch aus, der Header am Anfang ist etwas unterschiedlich, allerdings kann ich nicht ersehen was genau.</p>
<p>Hat jemand ne Idee? Wäre echt klasse!</p>
<p>P.S.: Laut MSDN sollte das bmi.bmiColors = 0 sein. Ich krieg aber ewig Compilerfehler, dass da was nicht klappt... Falls da auch noch jemand ne Idee zu hat, wäre ich auch dafür dankbar <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>
]]></description><link>https://www.c-plusplus.net/forum/topic/116386/bitmap-selbst-gemacht-geht-nicht-warum</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 04:29:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/116386.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Jul 2005 13:17:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Tue, 26 Jul 2005 13:17:06 GMT]]></title><description><![CDATA[<p>Tach zusammen!</p>
<p>Ich versuche ein Bitmap selbst zu bauen. Zu Testzwecken habe ich ein kleines Programm gebaut, dass mit ein &quot;unsinniges&quot; Bild erstellen soll.</p>
<pre><code class="language-cpp">int width         = 640;
   int height        = 480;
   int bytesPerPixel = 3;  // we need 24 bit (= 3x8 bit) for 24-Bit-RGB

   BITMAPFILEHEADER bmfh;
   BITMAPINFOHEADER bmih;
   BITMAPINFO bmi;
   BYTE *data = new BYTE[width*height*bytesPerPixel];

   bmfh.bfType       = 19778; // must be BM (or 19778 ASCII)
   bmfh.bfSize       = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + width*height*bytesPerPixel;
   bmfh.bfReserved1  = 0;
   bmfh.bfReserved2  = 0;
   bmfh.bfOffBits    = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);

   bmih.biSize          = sizeof(BITMAPINFOHEADER); // self size
   bmih.biWidth         = width;
   bmih.biHeight        = -height;  // negative to be a top-down-image
   bmih.biPlanes        = 1;  // must be 1
   bmih.biBitCount      = 8*bytesPerPixel; // we want a 24-bit-RGB-Image
   bmih.biCompression   = BI_RGB;   // uncompressed
   bmih.biSizeImage     = 0;  // because of BI_RGB in biCompression
   bmih.biXPelsPerMeter = 183; // pixels per meter? Microsoft's programmers ****!
   bmih.biYPelsPerMeter = 183; // pixels per meter? Microsoft's programmers ****!
   bmih.biClrUsed       = 0;  // unimportant for now
   bmih.biClrImportant  = 0;  // unimportant for now too

   bmi.bmiHeader        = bmih;
   //bmi.bmiColors        = 0;   // geht nicht!!!!!

   for(int index = 0; index &lt; height*width*bytesPerPixel; index++)
   {
      switch((index%3))
      {
         case 0: data[index] = 255; break; // Red; Image should be red
         case 1: data[index] = 0; break;   // Green; Image should be red
         case 2: data[index] = 0; break;   // Blue; Image should be red
      }

   }

   FILE *bmpFile = fopen(&quot;test.bmp&quot;, &quot;w+&quot;);  // open file
   if(bmpFile)
   {
      // write Bitmapfile
      fwrite(&amp;bmfh, sizeof(BITMAPFILEHEADER), 1, bmpFile);
      fwrite(&amp;bmi, sizeof(BITMAPINFO), 1, bmpFile);
      fwrite(data, width*height*bytesPerPixel, 1, bmpFile);

      fclose(bmpFile); // close file
   }
</code></pre>
<p>Beim öffnen der Datei in einem Grafikprogramm kommt die Meldung, dass das Dateiformat nicht bekannt sein. Windows zeigt auch keine Vorschau. Irgendwie ist das ganze Bild &quot;fritte&quot; und ich weiß nicht warum.</p>
<p>Hab auch mal ein rotes 24-Bit-RGB-Bitmap mit Paint erstellt (gleiche Grösse versteht sich). Im Editor vergleichen sehen beide Bilder fast identisch aus, der Header am Anfang ist etwas unterschiedlich, allerdings kann ich nicht ersehen was genau.</p>
<p>Hat jemand ne Idee? Wäre echt klasse!</p>
<p>P.S.: Laut MSDN sollte das bmi.bmiColors = 0 sein. Ich krieg aber ewig Compilerfehler, dass da was nicht klappt... Falls da auch noch jemand ne Idee zu hat, wäre ich auch dafür dankbar <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>
]]></description><link>https://www.c-plusplus.net/forum/post/839176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839176</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 26 Jul 2005 13:17:06 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Tue, 26 Jul 2005 16:56:49 GMT]]></title><description><![CDATA[<p>also bei mir funzt der code so wie er ist nur das ein grünes und kein rotes bild rauskommt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/839315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839315</guid><dc:creator><![CDATA[Abchecker]]></dc:creator><pubDate>Tue, 26 Jul 2005 16:56:49 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 05:49:02 GMT]]></title><description><![CDATA[<p>Ich will es mit dem Borland machen. Da gehts nicht. Wenn ichs im Visual Studio .NET versuche kriege ich auch ein grünes Bild.</p>
<p>Scheint also ein Entwicklungsumgebungsabhängig zu sein! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /></p>
<p>Im Vergleich die Header der beiden Bilder:<br />
Header im BCB (alles zwischen den Anführungsstrichen):</p>
<pre><code>&quot;BM 8     8   (   €   þÿÿ          ·   ·              &quot;
</code></pre>
<p>Header im <a href="http://VS.NET" rel="nofollow">VS.NET</a> (alles zwischen den Anführungsstrichen):</p>
<pre><code>&quot;BM6     6   (   €   þÿÿ          ·   ·               &quot;
</code></pre>
<p>Header im mit Paint erstellten Bild (alles zwischen den Anführungsstrichen):</p>
<pre><code>&quot;BM6     6   (   €  à                          &quot;
</code></pre>
<p>Aber der Vergleich mit Paint zeigt noch andere Unterschiede...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/839582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839582</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Wed, 27 Jul 2005 05:49:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 05:53:01 GMT]]></title><description><![CDATA[<p>Nachtrag zu oben:</p>
<p>So ganz in Ordnung ist das Bild aus dem <a href="http://VS.NET" rel="nofollow">VS.NET</a> auch nicht. Bei Versuch, das Bild mit nem Grafikprogramm (!= Paint) zu öffnen kommt die Meldung &quot;Bad Picture size&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/839585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839585</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Wed, 27 Jul 2005 05:53:01 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 07:28:02 GMT]]></title><description><![CDATA[<p>generier doch in paint ein bitmap und vergleiche diese dateien mit dem hexeditor.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/839628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839628</guid><dc:creator><![CDATA[hexer12]]></dc:creator><pubDate>Wed, 27 Jul 2005 07:28:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 10:06:44 GMT]]></title><description><![CDATA[<p>Guck doch mal in den FAQ: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39400.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39400.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/839771</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839771</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Wed, 27 Jul 2005 10:06:44 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 10:47:19 GMT]]></title><description><![CDATA[<p>Ich glaube du musst unten statt BITMAPINFO nur BITMAPINFOHEADER schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/839813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839813</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Wed, 27 Jul 2005 10:47:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 11:42:30 GMT]]></title><description><![CDATA[<p>geeky schrieb:</p>
<blockquote>
<p>Ich glaube du musst unten statt BITMAPINFO nur BITMAPINFOHEADER schreiben.</p>
</blockquote>
<p>Hab ich schon versucht, tut sich in dem Fall aber nichts.<br />
Habe jetzt schon mal eine Teillösung.<br />
Das Problem liegt beim BCB6. Beim Byte-weisen schreiben von Strukturen hat der &quot;Kollege&quot; einen Bug, nämlich dass jede Struktur 2 Byte länger geschrieben wird, als sie ist. Wurde im Update 4 behandelt, hab ich aber nicht drauf. <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="😉"
    /> Lässt sich aber auch über einen #pragma lösen.</p>
<p>Das ganze geht jetzt soweit auch im BCB. Das Problem der &quot;Bad Picture Size&quot;-Meldung liegt daran, dass</p>
<pre><code class="language-cpp">bmih.biHeight        = -height;  // negative to be a top-down-image
</code></pre>
<p>ist. Das muss negativ sein um ein top-down bild zu werden. Positiv gesetzt ist es ein bottom-up dings, was auch die verdrehten Farben erklärt (BGR statt RGB)</p>
<p>Ich danke euch trotzdem allen vielmals!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/839871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/839871</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Wed, 27 Jul 2005 11:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Wed, 27 Jul 2005 13:26:03 GMT]]></title><description><![CDATA[<p>Die Bitmap-Datengröße ist nicht einfach breite*höhe*bitsperpixel, da jede Scanline an 4-Byte-Grenzen ausgerichtet sein muss und der Rest der Scanline mit Nullen aufgefüllt wird. Hast du also ein 2*1*24-Bitmap müssen die Daten so aussehen:</p>
<p>XXXXXXXX XXXX0000</p>
<p>Besser wäre also dieser Weg, die Bitmap-Datengröße zu berechnen.</p>
<pre><code class="language-cpp">#define BITMAP_SIZE ( (((BITMAP_WIDTH * BITMAP_BPP) + ((BITMAP_WIDTH*BITMAP_BPP)%32)) / 8) * BITMAP_HEIGHT)
</code></pre>
<p>Die PixelsPerMeter-Werte brauchst du nur für geräteabhängige Bitmaps und stellen in dem Fall die Auflösung des Gerätes dar. Da helfen auch keine dummen Kommentare (für wen überhaupt?)</p>
<p>bmiColors ist in der Standard-Structdeklaration ein RGBQUAD[1]-Array. Das wird also mit <strong>bmi.bmiColors[0] = 0;</strong> auf null gesetzt, wobei das ja eigentlich nicht erforderlich ist, da du ja kein Bild mit indizierten Farben verwendest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/840010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/840010</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Wed, 27 Jul 2005 13:26:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Thu, 28 Jul 2005 05:28:08 GMT]]></title><description><![CDATA[<p>masterofx32 schrieb:</p>
<blockquote>
<p>Die Bitmap-Datengröße ist nicht einfach breite*höhe*bitsperpixel, da jede Scanline an 4-Byte-Grenzen ausgerichtet sein muss und der Rest der Scanline mit Nullen aufgefüllt wird. Hast du also ein 2*1*24-Bitmap müssen die Daten so aussehen:</p>
<p>XXXXXXXX XXXX0000</p>
<p>Besser wäre also dieser Weg, die Bitmap-Datengröße zu berechnen.</p>
<pre><code class="language-cpp">#define BITMAP_SIZE ( (((BITMAP_WIDTH * BITMAP_BPP) + ((BITMAP_WIDTH*BITMAP_BPP)%32)) / 8) * BITMAP_HEIGHT)
</code></pre>
</blockquote>
<p>Aha! Gut, Danke! Wusste ich nicht.</p>
<p>masterofx32 schrieb:</p>
<blockquote>
<p>Die PixelsPerMeter-Werte brauchst du nur für geräteabhängige Bitmaps und stellen in dem Fall die Auflösung des Gerätes dar. Da helfen auch keine dummen Kommentare (für wen überhaupt?)</p>
</blockquote>
<p>Die dummen Kommentare helfen da sicherlich, wenn auch nicht dir. Ich kommentiere Quellcode im seltensten Fall nur fürs Forum. Die Kommentare waren also vorher schon da. Für mich!<br />
Dumme Kommentare entstehen in diesem Fall, da meines Wissens nach üblicherweise diese Werte in dpi, also dots per inch = pixel pro Zoll(!) und nicht pro Meter(!) angegeben werden, was nach meiner Meinung wieder eine unnötige Umrechnung birgt.<br />
Solltest du dich durch meine derart dummen Kommentare persönlich angegriffen fühlen, übernehme ich selbstverständlich die gesamte Verantwortung, bin zutiefst betroffen und entschuldige mich mehrfach! <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>masterofx32 schrieb:</p>
<blockquote>
<p>bmiColors ist in der Standard-Structdeklaration ein RGBQUAD[1]-Array.<br />
Das wird also mit <strong>bmi.bmiColors[0] = 0;</strong> auf null gesetzt,</p>
</blockquote>
<p>Dachte ich auch, lässt aber mein Compiler nicht zu. Auch alle anderen Versuche schlugen fehl!</p>
<p>masterofx32 schrieb:</p>
<blockquote>
<p>wobei das ja eigentlich nicht erforderlich ist, da du ja kein Bild mit indizierten Farben verwendest.</p>
</blockquote>
<p>Noch. Das hier war quasi nur die Vorstufe. Ich muss mal sehen, in wie fern ich da noch weiter &quot;rum experimentiere&quot;. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<p>Danke für deine Mühe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/840483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/840483</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Thu, 28 Jul 2005 05:28:08 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Thu, 28 Jul 2005 06:34:12 GMT]]></title><description><![CDATA[<p>bmfh.bfType = MAKEWORD('B', 'M');</p>
]]></description><link>https://www.c-plusplus.net/forum/post/840494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/840494</guid><dc:creator><![CDATA[offtopic-vorschlag]]></dc:creator><pubDate>Thu, 28 Jul 2005 06:34:12 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap selbst gemacht - Geht nicht! - Warum? on Thu, 28 Jul 2005 12:20:09 GMT]]></title><description><![CDATA[<p>el Clio schrieb:</p>
<blockquote>
<p>Solltest du dich durch meine derart dummen Kommentare persönlich angegriffen fühlen, übernehme ich selbstverständlich die gesamte Verantwortung, bin zutiefst betroffen und entschuldige mich mehrfach! <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>
</blockquote>
<p><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>Mit der Angabe in Pixeln pro Meter hat man ja eine bessere &quot;Ganzzahl-Auflösung&quot;. Denn würde man ein DDB für eine Videowand mit 100 Pixeln pro Meter erstellen, ließe sich das in DPI nur ungenau ganzzahlig ausdrücken. Außerdem ist das metrische System sowieso das bessere. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>el Clio schrieb:</p>
<blockquote>
<p>masterofx32 schrieb:</p>
<blockquote>
<p>bmiColors ist in der Standard-Structdeklaration ein RGBQUAD[1]-Array.<br />
Das wird also mit <strong>bmi.bmiColors[0] = 0;</strong> auf null gesetzt,</p>
</blockquote>
<p>Dachte ich auch, lässt aber mein Compiler nicht zu. Auch alle anderen Versuche schlugen fehl!</p>
</blockquote>
<p>Ach so, ich nahm an, dass RGBQUAD auch nur ein DWORD sei wie COLORREF. Habe ich mich wohl geirrt. Keine Ahnung, wie das in dem Beispielquelltext gemacht wurde. Da es dafür scheinbar kein Makro gibt, wirst du es wohl so machen müssen:</p>
<pre><code class="language-cpp">bmi.bmiColors[0].rgbBlue = 0;
bmi.bmiColors[0].rgbGreen = 0;
bmi.bmiColors[0].rgbRed = 0;
bmi.bmiColors[0].rgbReserved = 0;

//oder

ZeroMemory(bmi.bmiColors,sizeof(RGBQUAD));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/840742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/840742</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Thu, 28 Jul 2005 12:20:09 GMT</pubDate></item></channel></rss>