<?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[setpixel problem. farbe schwarz anstatt bunt.]]></title><description><![CDATA[<p>Soweit funktioniert auch alles. es geht um die zeilen 23&amp;24. wenn ich das aus zeile 24 nehme, malt er mir auch schöne blaue senkrechte striche. nehme ich das aus zeile 23 sind die slle schwarz, aber eigentlich müssten die doch farbig sein, jenachdem welcher Buchstabe gespeichert ist. weiß einer warum das so net klappt?</p>
<pre><code class="language-cpp">{
COLORREF A = RGB(0,0,255);
COLORREF T = RGB(0,255,0);
COLORREF C = RGB(255,0,0);
COLORREF G = RGB(0,255,255);

void senkrecht(HDC, int, int, int, COLORREF);
int y(double),x(double),i;

char *dna;
dna = (char *) malloc (10 * sizeof(char));

dna[0]='T';
dna[1]='A';
dna[2]='A';
dna[3]='C';
dna[4]='G';
dna[5]='\0';

i=0;
do
{
	senkrecht(hDC,x(i),y(5),y(6),dna[i]);
	//senkrecht(hDC,x(i),y(5),y(6),A);
	i++;
}while(i&lt;5);
}

// Funktionen

int y(double y)
{
	return (int)(y * (-10) + 250); // koordinate * (-)! Streckung/Stauchung + Achsenverschiebung
}

int x(double x)
{
	return (int)(x * 10 + 100); // koordinate * Streckung/Stauchung + Achsenverschiebung
}

void senkrecht(HDC hdc, int x, int ya, int ye, COLORREF farbe)
{
	int i=0, swap=0;
	if(ye &lt; ya)
	{
		swap = ya;
		ya = ye;
		ye = swap;
	}
	for(i=ya;i&lt;=ye;i++)
	{
		SetPixel(hdc,x,i,farbe);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/212935/setpixel-problem-farbe-schwarz-anstatt-bunt</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 22:16:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212935.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 May 2008 14:23:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to setpixel problem. farbe schwarz anstatt bunt. on Mon, 12 May 2008 14:23:59 GMT]]></title><description><![CDATA[<p>Soweit funktioniert auch alles. es geht um die zeilen 23&amp;24. wenn ich das aus zeile 24 nehme, malt er mir auch schöne blaue senkrechte striche. nehme ich das aus zeile 23 sind die slle schwarz, aber eigentlich müssten die doch farbig sein, jenachdem welcher Buchstabe gespeichert ist. weiß einer warum das so net klappt?</p>
<pre><code class="language-cpp">{
COLORREF A = RGB(0,0,255);
COLORREF T = RGB(0,255,0);
COLORREF C = RGB(255,0,0);
COLORREF G = RGB(0,255,255);

void senkrecht(HDC, int, int, int, COLORREF);
int y(double),x(double),i;

char *dna;
dna = (char *) malloc (10 * sizeof(char));

dna[0]='T';
dna[1]='A';
dna[2]='A';
dna[3]='C';
dna[4]='G';
dna[5]='\0';

i=0;
do
{
	senkrecht(hDC,x(i),y(5),y(6),dna[i]);
	//senkrecht(hDC,x(i),y(5),y(6),A);
	i++;
}while(i&lt;5);
}

// Funktionen

int y(double y)
{
	return (int)(y * (-10) + 250); // koordinate * (-)! Streckung/Stauchung + Achsenverschiebung
}

int x(double x)
{
	return (int)(x * 10 + 100); // koordinate * Streckung/Stauchung + Achsenverschiebung
}

void senkrecht(HDC hdc, int x, int ya, int ye, COLORREF farbe)
{
	int i=0, swap=0;
	if(ye &lt; ya)
	{
		swap = ya;
		ya = ye;
		ye = swap;
	}
	for(i=ya;i&lt;=ye;i++)
	{
		SetPixel(hdc,x,i,farbe);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1507512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507512</guid><dc:creator><![CDATA[Darkangel1208]]></dc:creator><pubDate>Mon, 12 May 2008 14:23:59 GMT</pubDate></item><item><title><![CDATA[Reply to setpixel problem. farbe schwarz anstatt bunt. on Mon, 12 May 2008 15:29:51 GMT]]></title><description><![CDATA[<p>Du übergibst einmal einen char, und einmal diese COLORREF-struct.</p>
<p>Na, siehst du den Unterschied?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507542</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Mon, 12 May 2008 15:29:51 GMT</pubDate></item><item><title><![CDATA[Reply to setpixel problem. farbe schwarz anstatt bunt. on Mon, 12 May 2008 16:27:06 GMT]]></title><description><![CDATA[<p>ja seh ich jetzt.<br />
ich habe es nun auf ... geändert und nun klappt es.</p>
<pre><code class="language-cpp">void senkrecht(HDC hdc, int x, int ya, int ye, COLORREF farbe)
{
	if (farbe == 'A')
		farbe = RGB(0,0,255);
	if (farbe == 'T')
		farbe = RGB(0,255,0);
	if (farbe == 'C')
		farbe = RGB(255,0,0);
	if (farbe == 'G')
		farbe = RGB(0,255,255);
	int i=0, swap=0;
	if(ye &lt; ya)
	{
		swap = ya;
		ya = ye;
		ye = swap;
	}
	for(i=ya;i&lt;=ye;i++)
	{
		SetPixel(hdc,x,i,farbe);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1507573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507573</guid><dc:creator><![CDATA[Darkangel1208]]></dc:creator><pubDate>Mon, 12 May 2008 16:27:06 GMT</pubDate></item><item><title><![CDATA[Reply to setpixel problem. farbe schwarz anstatt bunt. on Mon, 12 May 2008 16:31:46 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-10455.html" rel="nofollow">evilissimo</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507575</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 12 May 2008 16:31:46 GMT</pubDate></item></channel></rss>