<?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[Auf Backbuffer lässt sich nicht farbig zeichnen]]></title><description><![CDATA[<p>Erstellt wird der Buffer folgendermaßen:</p>
<pre><code class="language-cpp">hdc=GetDC(hWnd);
				backbuffer=CreateCompatibleDC(hdc);
				hbmp = CreateCompatibleBitmap(backbuffer, WNDWIDTH, WNDHEIGHT); //Bitmap erstellen
				hbmpold = (HBITMAP)SelectObject(backbuffer, hbmp);           //Bitmap auswählen, altes speichern

				hbrush = CreateSolidBrush(RGB(255, 255, 255));				//weissen Brush erstellen
				FillRect(backbuffer, drawrec, hbrush);						//weiss malen
</code></pre>
<p>Nun hab ich das Problem, dass weder SetPixel(...,RGB(..)) farbig zeichnet noch LineTo usw. wenn ich einen bestimmten farbigen Stift auswähle. In einem anderen Thread stand etwas von wegen SetPixel usw. arbeiten mit COLORREF strukturen, Bitmaps erwarten jedoch RGBQUAD Farbwerte. Wie kann ich da jetzt dennoch mit SetPixel usw. farbig malen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191448/auf-backbuffer-lässt-sich-nicht-farbig-zeichnen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 13:39:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191448.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Sep 2007 12:18:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 16:28:12 GMT]]></title><description><![CDATA[<p>Erstellt wird der Buffer folgendermaßen:</p>
<pre><code class="language-cpp">hdc=GetDC(hWnd);
				backbuffer=CreateCompatibleDC(hdc);
				hbmp = CreateCompatibleBitmap(backbuffer, WNDWIDTH, WNDHEIGHT); //Bitmap erstellen
				hbmpold = (HBITMAP)SelectObject(backbuffer, hbmp);           //Bitmap auswählen, altes speichern

				hbrush = CreateSolidBrush(RGB(255, 255, 255));				//weissen Brush erstellen
				FillRect(backbuffer, drawrec, hbrush);						//weiss malen
</code></pre>
<p>Nun hab ich das Problem, dass weder SetPixel(...,RGB(..)) farbig zeichnet noch LineTo usw. wenn ich einen bestimmten farbigen Stift auswähle. In einem anderen Thread stand etwas von wegen SetPixel usw. arbeiten mit COLORREF strukturen, Bitmaps erwarten jedoch RGBQUAD Farbwerte. Wie kann ich da jetzt dennoch mit SetPixel usw. farbig malen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357837</guid><dc:creator><![CDATA[MasterCounter]]></dc:creator><pubDate>Mon, 03 Sep 2007 16:28:12 GMT</pubDate></item><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 13:36:09 GMT]]></title><description><![CDATA[<p>Es scheint so als würde nur ein monochromes Bitmap erstellt <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=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357934</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357934</guid><dc:creator><![CDATA[MasterCounter]]></dc:creator><pubDate>Mon, 03 Sep 2007 13:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 15:11:18 GMT]]></title><description><![CDATA[<p>MasterCounter schrieb:</p>
<blockquote>
<p>von wegen SetPixel usw. arbeiten mit COLORREF strukturen</p>
</blockquote>
<p>COLORREF ist keine Struktur, sondern ein primitiver Datentyp (unsigned int).<br />
Zeig mal mehr Code. Wie zeichnest Du in Deinen Back-Buffer?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358047</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 03 Sep 2007 15:11:18 GMT</pubDate></item><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 16:26:22 GMT]]></title><description><![CDATA[<p>ganz einfach, nur ums zu testen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /> Die Linien sind aber immer schwarz, egal ob ich extra einen Pen erstelle (was man bei SetPixel doch gar nicht muss, denk ich mal) oder ob ichs ohne mache...</p>
<pre><code class="language-cpp">hdc=GetDC(hWnd);
backbuffer=CreateCompatibleDC(hdc);
hbmp = CreateCompatibleBitmap(backbuffer, WNDWIDTH, WNDHEIGHT); //Bitmap erstellen
hbmpold = (HBITMAP)SelectObject(backbuffer, hbmp);           //Bitmap auswählen, altes speichern

hbrush = CreateSolidBrush(RGB(255, 255, 255));                //weissen Brush erstellen
FillRect(backbuffer, drawrec, hbrush);                        //weiss malen         

x=0;
y=0;

while(x&lt;WNDWIDTH &amp;&amp; y&lt;WNDHEIGHT)
{
SetPixel(backbuffer,(int)x,(int)y,RGB(255,0,0));
x++;
y++;
}

BitBlt(hdc,deleterc-&gt;left,deleterc-&gt;top,deleterc-&gt;right,deleterc-&gt;bottom,backbuffer,deleterc-&gt;left,deleterc-&gt;top,SRCCOPY);
// Freigabe der Objekte
SelectObject(backbuffer, hbmpold);
DeleteObject(hbmp);
DeleteDC(backbuffer);
ReleaseDC(hWnd, hdc);	
DeleteObject(hbrush);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1358107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358107</guid><dc:creator><![CDATA[MasterCounter]]></dc:creator><pubDate>Mon, 03 Sep 2007 16:26:22 GMT</pubDate></item><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 16:55:23 GMT]]></title><description><![CDATA[<p>Gib bei CreateCompatibleBitmap() nicht 'backbuffer' sondern 'hdc' an!</p>
<p>Das Handle das CreateCompatibleDC() ist standardmässig mit ner 1x1 großen Monochrom-Bitmap versehen, daher wird die Bitmap die CreateCompatibleDC() dann erzeugt auch monochrom <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358140</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 03 Sep 2007 16:55:23 GMT</pubDate></item><item><title><![CDATA[Reply to Auf Backbuffer lässt sich nicht farbig zeichnen on Mon, 03 Sep 2007 17:14:38 GMT]]></title><description><![CDATA[<p>läuft jetzt -.- Ohne Witz, manchmal könnt ich meinen Kopf runterreissen und gegen ne Wand prügeln.... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> Vielen, vielen Dank an dich! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358158</guid><dc:creator><![CDATA[MasterCounter]]></dc:creator><pubDate>Mon, 03 Sep 2007 17:14:38 GMT</pubDate></item></channel></rss>