<?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[falsche werte werden mit scanline geschrieben]]></title><description><![CDATA[<p>kann mir jemand sagen wieso mit nachfolgendem code zwar bei i=0 ein schwarzes bitmap erzeugt wird, jedoch mit i=1 das bitmap den wert 43 beinhaltet?</p>
<pre><code class="language-cpp">for(int 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) colorValue;
         x++;
      }
      colorValue++;
      smallImg-&gt;Palette = grayPal;
      smallImg-&gt;SaveToFile(&quot;clusterColor_&quot; + IntToStr(i) + &quot;.bmp&quot;);
      images-&gt;Insert(i, smallImg, NULL);
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/83175/falsche-werte-werden-mit-scanline-geschrieben</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 19:45:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/83175.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Aug 2004 12:45:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to falsche werte werden mit scanline geschrieben on Wed, 18 Aug 2004 12:45:06 GMT]]></title><description><![CDATA[<p>kann mir jemand sagen wieso mit nachfolgendem code zwar bei i=0 ein schwarzes bitmap erzeugt wird, jedoch mit i=1 das bitmap den wert 43 beinhaltet?</p>
<pre><code class="language-cpp">for(int 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) colorValue;
         x++;
      }
      colorValue++;
      smallImg-&gt;Palette = grayPal;
      smallImg-&gt;SaveToFile(&quot;clusterColor_&quot; + IntToStr(i) + &quot;.bmp&quot;);
      images-&gt;Insert(i, smallImg, NULL);
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/585373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/585373</guid><dc:creator><![CDATA[mattias]]></dc:creator><pubDate>Wed, 18 Aug 2004 12:45:06 GMT</pubDate></item></channel></rss>