<?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[images für small images schneller erzeugen]]></title><description><![CDATA[<p>ich habe eine ListView in dem mehrere einträge stehen und zu<br />
jedem eintrag ein smallImage am anfang der spalte dargestellt ist. die bitmaps schreibe ich in eine ImageList, jedes bitmap ist 10 x 14 pixels groß. die imagList enthält 256 bitmaps, also für jeden grauwert ein bitmap. jedes einzelne bitmap erzeuge ich mit folgendem code:</p>
<pre><code class="language-cpp">ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
   for(int j=0; j &lt; (smallImg-&gt;Height * smallImg-&gt;Width); j++) {
   if(x == smallImg-&gt;Width) {
      y++;
      x = 0;
      ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
   }
   ptr[x]= i;
   x++;
}
</code></pre>
<p>nun ist mein problem, dass die erstellung der 256 bitmaps ziemlich lange dauert. weiß jemand wie man die bilder schneller erstellen kann. ich hab mir schon überlegt die bilder abzuspeichern, dann hab ich aber 256 dateien, was nicht gerade ideal ist. meine hoffnung ist dass man die bilder, da sie ja nur einen farbwert haben, mit einer einzigen anweisung erzeugen kann.</p>
<p>vielen dank<br />
mattias</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/78129/images-für-small-images-schneller-erzeugen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 12:54:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/78129.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Jun 2004 11:39:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 11:39:07 GMT]]></title><description><![CDATA[<p>ich habe eine ListView in dem mehrere einträge stehen und zu<br />
jedem eintrag ein smallImage am anfang der spalte dargestellt ist. die bitmaps schreibe ich in eine ImageList, jedes bitmap ist 10 x 14 pixels groß. die imagList enthält 256 bitmaps, also für jeden grauwert ein bitmap. jedes einzelne bitmap erzeuge ich mit folgendem code:</p>
<pre><code class="language-cpp">ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
   for(int j=0; j &lt; (smallImg-&gt;Height * smallImg-&gt;Width); j++) {
   if(x == smallImg-&gt;Width) {
      y++;
      x = 0;
      ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
   }
   ptr[x]= i;
   x++;
}
</code></pre>
<p>nun ist mein problem, dass die erstellung der 256 bitmaps ziemlich lange dauert. weiß jemand wie man die bilder schneller erstellen kann. ich hab mir schon überlegt die bilder abzuspeichern, dann hab ich aber 256 dateien, was nicht gerade ideal ist. meine hoffnung ist dass man die bilder, da sie ja nur einen farbwert haben, mit einer einzigen anweisung erzeugen kann.</p>
<p>vielen dank<br />
mattias</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549247</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Mon, 28 Jun 2004 11:39:07 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 11:53:49 GMT]]></title><description><![CDATA[<p>mattias schrieb:</p>
<blockquote>
<p>ich hab mir schon überlegt die bilder abzuspeichern, dann hab ich aber 256 dateien, was nicht gerade ideal ist.</p>
</blockquote>
<p>Hi,<br />
wenn man die Bilder einmal in der ImageList hat, kann man die ursprünglichen Dateien löschen....<br />
Die Bilder werden al Recource im Programm gespeichert...</p>
<p>MfG</p>
<p>Alexander Sulfrian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549254</guid><dc:creator><![CDATA[Alexander Sulfrian]]></dc:creator><pubDate>Mon, 28 Jun 2004 11:53:49 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 11:54:24 GMT]]></title><description><![CDATA[<p>DeinBitmap::Canvas::Brush::Color auf den gewünschten Farbwert setzen und den Canvas mit FillRect ausmalen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549255</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 28 Jun 2004 11:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 13:30:06 GMT]]></title><description><![CDATA[<p>Alexander Sulfrian schrieb:</p>
<blockquote>
<p>wenn man die Bilder einmal in der ImageList hat, kann man die ursprünglichen Dateien löschen....<br />
Die Bilder werden al Recource im Programm gespeichert...</p>
</blockquote>
<p>wie soll das genau funktionieren, dass die Imagelist als ressource im programm gespeichert wird?</p>
<p>mfg mattias</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549322</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Mon, 28 Jun 2004 13:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 14:13:55 GMT]]></title><description><![CDATA[<blockquote>
<p>Die Bilder werden al Recource im Programm gespeichert</p>
</blockquote>
<p>Das funktioniert nur wenn man die Bilder zur Entwurfszeit der ImageList zuweist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549330</guid><dc:creator><![CDATA[Peter]]></dc:creator><pubDate>Mon, 28 Jun 2004 14:13:55 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 17:38:04 GMT]]></title><description><![CDATA[<p>Wie weise ich nun einer ImageList zur Compilezeit Bilder zu? <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>
]]></description><link>https://www.c-plusplus.net/forum/post/549488</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549488</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Mon, 28 Jun 2004 17:38:04 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 18:10:35 GMT]]></title><description><![CDATA[<p>mattias schrieb:</p>
<blockquote>
<p>zur Compilezeit</p>
</blockquote>
<p>Hi,<br />
was meinst du? Ich kann nur zur Entwurfs- oder Laufzeit der ImageList Bilder zuweisen! (zur Entwurfszeit einfach mit Doppelklick auf die ImageList im Formular)</p>
<p>MfG</p>
<p>Alexander Sulfrian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549512</guid><dc:creator><![CDATA[Alexander Sulfrian]]></dc:creator><pubDate>Mon, 28 Jun 2004 18:10:35 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Mon, 28 Jun 2004 18:15:40 GMT]]></title><description><![CDATA[<p>Mit Add bzw. Insert!? Aber das müsstest du doch eigentlich schon wissen, sonst hätte dein Code oben doch gar nicht funktioniert (bzw. wäere sinnlos)?</p>
<pre><code class="language-cpp">Graphics::TBitmap *bmp = new Graphics::TBitmap();
  bmp-&gt;PixelFormat = pf24bit;
  bmp-&gt;Width = ImageList1-&gt;Width;
  bmp-&gt;Height = ImageList1-&gt;Height;
  for (int i = 255; i &gt;= 0; i--)
  {
    bmp-&gt;Canvas-&gt;Brush-&gt;Color = (i &lt;&lt; 16)|(i &lt;&lt; 8)| i; // Graustufe
    bmp-&gt;Canvas-&gt;FillRect(bmp-&gt;Canvas-&gt;ClipRect);
    ImageList1-&gt;Add(bmp, 0);
  }
  delete bmp;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/549520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549520</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 28 Jun 2004 18:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Tue, 29 Jun 2004 07:39:28 GMT]]></title><description><![CDATA[<p>alles klar, ich glaubte ihr meint die images in einer ressourcen-datei, so wie bei audiofiles, in einer rc-datei abspeichern. mit dem kenn ich mich leider nicht so aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549693</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Tue, 29 Jun 2004 07:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Tue, 29 Jun 2004 07:52:45 GMT]]></title><description><![CDATA[<p>Dann mach es doch so, wie Jansen vorschlägt....</p>
<p>Seine Fassung benötigt ca. 20 ms die 256 Bitmaps zu erzeugen. Deine Fassung benötigt ca. 1300 ms...</p>
<p>Ich würde nur diese Zeile ändern (um die Warnung 'TColor wird mit int...' zu beseitigen)<br />
[cpp]bmp-&gt;Canvas-&gt;Brush-&gt;Color = <strong>(TColor)</strong> (i &lt;&lt; 16)|(i &lt;&lt; 8)| i; // Graustufe[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549699</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549699</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 29 Jun 2004 07:52:45 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Tue, 29 Jun 2004 08:55:24 GMT]]></title><description><![CDATA[<p>Hier hab ich noch ein Problem, wo ich nicht den Fehler finde. Ich erzeuge eben ein 8 bit Bitmap und will nun die Bilder auf der Festplatte speichern vom Dunklen bis zum Hellen.</p>
<pre><code class="language-cpp">for(short i = 0 ; i &lt; 256 ; i++) {
      Graphics::TBitmap *smallImg = new Graphics::TBitmap();
      smallImg-&gt;Width = 10; smallImg-&gt;Height = 14;
      smallImg-&gt;PixelFormat = pf8bit;

      unsigned char *ptr;
      int x=0, y=0;
      ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
      for(int j=0; j &lt; (smallImg-&gt;Height * smallImg-&gt;Width); j++) {
         if(x == smallImg-&gt;Width) {
            y++;
            x = 0;
            ptr = static_cast&lt;BYTE*&gt;(smallImg-&gt;ScanLine[y]);
         }
         ptr[x]= (BYTE) i;
         x++;
      }
      smallImg-&gt;Palette = grayPal;
      smallImg-&gt;SaveToFile(&quot;clusterColor_&quot; + IntToStr(i) + &quot;.bmp&quot;);
   }
</code></pre>
<p>Die Palette hab ich mit folgendem Code erzeugt:</p>
<pre><code class="language-cpp">LOGPALETTE* pal = NULL;
    try {
       pal = (LOGPALETTE*) malloc( sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * 256);
       pal-&gt;palVersion = 0x300;
       pal-&gt;palNumEntries = 256;
       for(short i = 0 ; i &lt; 256 ; i++) {
          pal-&gt;palPalEntry[i].peRed =  (Byte)i;
          pal-&gt;palPalEntry[i].peGreen = pal-&gt;palPalEntry[i].peRed;
          pal-&gt;palPalEntry[i].peBlue = pal-&gt;palPalEntry[i].peRed;
       }
       grayPal = CreatePalette(pal);
    }
    __finally {
       delete pal;
    }
</code></pre>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox181021" checked="true" /><label for="checkbox181021">das Zeichen '\a' oder dez 97. Warum?</label></div></p>
]]></description><link>https://www.c-plusplus.net/forum/post/549722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549722</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Tue, 29 Jun 2004 08:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to images für small images schneller erzeugen on Tue, 29 Jun 2004 12:00:45 GMT]]></title><description><![CDATA[<p>Noch einmal der Hinweis: Einfacher und schneller als mit Jansens Beispiel kannst Du es nicht haben...</p>
<p>Probleme mit LOGPALETTE gehören m.E. in das WinAPI-Forum. Ich vermute das Problem aber darin, dass Du peFLAGS nicht verwendest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/549750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/549750</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 29 Jun 2004 12:00:45 GMT</pubDate></item></channel></rss>