<?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[Farbverlauf]]></title><description><![CDATA[<p>Hallo zusammen!<br />
Ich benötige für ein Programm einen &quot;flüssigen&quot; Farbverlauf als testprogramm hab ich folgendes geschrieben</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int a = 0; a &lt; 960; a++)
{
for (int b = 0; b &lt; 105; b++)
PaintBox1-&gt;Canvas-&gt;Pixels[b][a] = a;
}
}
</code></pre>
<p>leider gibt es so gleich mehrere Verläufe und jedesmal von ganz schwarz bis rot (also FF0000) und dann gibt es einen &quot;Bruch&quot; doch gerade soetwas will ich vermeiden!!<br />
Wist ihr wie ich des besser machen könnte???<br />
MfG Straightflush</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/134681/farbverlauf</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 04:41:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/134681.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Jan 2006 17:41:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 17:41:52 GMT]]></title><description><![CDATA[<p>Hallo zusammen!<br />
Ich benötige für ein Programm einen &quot;flüssigen&quot; Farbverlauf als testprogramm hab ich folgendes geschrieben</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int a = 0; a &lt; 960; a++)
{
for (int b = 0; b &lt; 105; b++)
PaintBox1-&gt;Canvas-&gt;Pixels[b][a] = a;
}
}
</code></pre>
<p>leider gibt es so gleich mehrere Verläufe und jedesmal von ganz schwarz bis rot (also FF0000) und dann gibt es einen &quot;Bruch&quot; doch gerade soetwas will ich vermeiden!!<br />
Wist ihr wie ich des besser machen könnte???<br />
MfG Straightflush</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978284</guid><dc:creator><![CDATA[Straightflush]]></dc:creator><pubDate>Fri, 27 Jan 2006 17:41:52 GMT</pubDate></item><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 17:55:10 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>wie soll denn dein Farbverlauf aussehen? Von welcher Farbe zu welcher?</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978294</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978294</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 27 Jan 2006 17:55:10 GMT</pubDate></item><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 18:01:58 GMT]]></title><description><![CDATA[<p>hauptsache flüssig! Am besten natürlich wie nen Regenbogen also wie des gesamte Spektrum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978305</guid><dc:creator><![CDATA[Straightflush]]></dc:creator><pubDate>Fri, 27 Jan 2006 18:01:58 GMT</pubDate></item><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 18:32:35 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Das ist nur eine Frage des richtigen Iterierens im richtigen Bereich.<br />
Eine Farbe besteht aus einen Rot-,einem Grün- und einem Blauanteil im Bereich von 0-256. Diese Grundfarben werden dann gemischt.<br />
Zum Mischen kannst du das WinAPI-Makro RGB nehmen</p>
<pre><code class="language-cpp">for (int a = 0; a &lt; 256; a++)
  {
    for (int b = 0; b &lt; 105; b++)
      PaintBox1-&gt;Canvas-&gt;Pixels[a][b] = RGB(a,0,0);
    }
</code></pre>
<p>Um einen Regenbogenverlauf hinzubekommen, must du jede einzelne enthalte Farbe nacheinander hintereinander übergehen lassen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978344</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 27 Jan 2006 18:32:35 GMT</pubDate></item><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 21:02:00 GMT]]></title><description><![CDATA[<p>Also ich hab des ganze jetzt folgendermaßen gelöst, das programm beginnt bei schwarz und und wechselt dann auf &quot;ewig&quot; im bunten durch...</p>
<pre><code class="language-cpp">while (farbencount &gt; 1785) farbencount = farbencount - 1530;
         if (farbencount &lt;=255)
         PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(farbencount,0,0);
         if ((farbencount &gt; 255) &amp;&amp; (farbencount &lt;= 510))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(255,0,farbencount-255);
           if ((farbencount &gt; 510) &amp;&amp; (farbencount &lt;= 765))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(765-farbencount,0,255);
          if ((farbencount &gt; 765) &amp;&amp; (farbencount &lt;= 1020))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(0,farbencount-765,255);
          if ((farbencount &gt; 1020) &amp;&amp; (farbencount &lt;= 1275))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(0,255,1275-farbencount);
          if ((farbencount &gt; 1275) &amp;&amp; (farbencount &lt;= 1530))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(farbencount-1275,255,0);
         if ((farbencount &gt; 1530) &amp;&amp; (farbencount &lt;= 1785))
          PaintBox1-&gt;Canvas-&gt;Pixels
         [(Xpixels - Xstart) * (1/g)][(Ypixels - Ystart) * (1/g)]
         = RGB(255,1785-farbencount,0);
</code></pre>
<p>wie könnte ich diesen Teil einfacher/schneller machen??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978489</guid><dc:creator><![CDATA[Straightflush]]></dc:creator><pubDate>Fri, 27 Jan 2006 21:02:00 GMT</pubDate></item><item><title><![CDATA[Reply to Farbverlauf on Fri, 27 Jan 2006 21:28:26 GMT]]></title><description><![CDATA[<p>Der Zugriff auf Canvas-&gt;Pixels[][] ist grundsätzlich langsam.<br />
Du kannst es über die Eigenschaft Scanline versuchen. Und zusätzlich erst zeichnen und dann ausgeben. Also erst in ein Bitmap schreiben und dann das gesamte Bitmap an die Paintbox zuweisen.</p>
<p>Grüße Joe_M.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/978509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/978509</guid><dc:creator><![CDATA[zufaulzumeinloggen]]></dc:creator><pubDate>Fri, 27 Jan 2006 21:28:26 GMT</pubDate></item></channel></rss>