<?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[Hintergrund bei TextOut]]></title><description><![CDATA[<p>Ich möchte eine kleine Funktion (bzw. Methode) schreiben die mir ein schwarzen Kreis mit Weisser Schrift ausgibt. nun ist um die Schrift ein weisser Hintergrund. Der soll schwarz werden.<br />
Wie mach ich das?</p>
<pre><code>//im Konstruktor
PenBlack=CreatePen(PS_SOLID, 1, RGB(0,0,0));
BlackBrush=CreateSolidBrush(RGB(0,0,0));
//die Methode
void Menue::paintGrafik(int X, int Y)
{
    hdc = GetDC(hwnd);
    SelectObject(hdc, PenBlack);
    SelectObject(hdc, BlackBrush);
    Ellipse(hdc, X, Y, X+90, Y+50);
    SelectObject(hdc, BlackBrush);
    SetTextColor(hdc, RGB(255,255,255));
    TextOut (hdc, X+10, Y+15, TEXT(&quot;ein Text&quot;),8);
    ReleaseDC(hwnd, hdc);
}
</code></pre>
<p>im Prinzip muss ich nur den Hintergrund für das TextOut setzen.?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/178622/hintergrund-bei-textout</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 13:14:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/178622.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Apr 2007 21:35:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hintergrund bei TextOut on Thu, 12 Apr 2007 21:35:39 GMT]]></title><description><![CDATA[<p>Ich möchte eine kleine Funktion (bzw. Methode) schreiben die mir ein schwarzen Kreis mit Weisser Schrift ausgibt. nun ist um die Schrift ein weisser Hintergrund. Der soll schwarz werden.<br />
Wie mach ich das?</p>
<pre><code>//im Konstruktor
PenBlack=CreatePen(PS_SOLID, 1, RGB(0,0,0));
BlackBrush=CreateSolidBrush(RGB(0,0,0));
//die Methode
void Menue::paintGrafik(int X, int Y)
{
    hdc = GetDC(hwnd);
    SelectObject(hdc, PenBlack);
    SelectObject(hdc, BlackBrush);
    Ellipse(hdc, X, Y, X+90, Y+50);
    SelectObject(hdc, BlackBrush);
    SetTextColor(hdc, RGB(255,255,255));
    TextOut (hdc, X+10, Y+15, TEXT(&quot;ein Text&quot;),8);
    ReleaseDC(hwnd, hdc);
}
</code></pre>
<p>im Prinzip muss ich nur den Hintergrund für das TextOut setzen.?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264978</guid><dc:creator><![CDATA[Schreiberling]]></dc:creator><pubDate>Thu, 12 Apr 2007 21:35:39 GMT</pubDate></item><item><title><![CDATA[Reply to Hintergrund bei TextOut on Thu, 12 Apr 2007 21:49:16 GMT]]></title><description><![CDATA[<p>microsoft settextcolor</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264984</guid><dc:creator><![CDATA[keksekekse]]></dc:creator><pubDate>Thu, 12 Apr 2007 21:49:16 GMT</pubDate></item><item><title><![CDATA[Reply to Hintergrund bei TextOut on Thu, 12 Apr 2007 22:04:53 GMT]]></title><description><![CDATA[<p>SetTextColor(hdc, RGB(255,255,255)); ???</p>
<p>Habe ich doch drinen!<br />
Bitte Antworte doch in ganzen Sätzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264989</guid><dc:creator><![CDATA[Schreiberling]]></dc:creator><pubDate>Thu, 12 Apr 2007 22:04:53 GMT</pubDate></item><item><title><![CDATA[Reply to Hintergrund bei TextOut on Thu, 12 Apr 2007 23:20:58 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool Menu::paint_graphic(int x, int y)
{
	HDC hDC = GetDC(m_hWnd);
	HPEN	hPenBlack	= CreatePen(PS_SOLID, 1, RGB(0,0,0));
	HBRUSH	hBrushBlack	= CreateSolidBrush(RGB(0,0,0));
	HGDIOBJ hOldPen		= SelectObject(hDC, hPenBlack);
	HGDIOBJ hOldBrush	= SelectObject(hDC, hBrushBlack);
	Ellipse(hDC, x, y, x + 90, y + 50);
	SelectObject(hOldBrush);
	SelectObject(hOldPen);
	DeleteObject(hPenBlack);
	DeleteObject(hBrushBlack);

	SetBkMode(TRANSPARENT);
	SetTextColor(hDC, RGB(255, 255, 255));
	TextOut(hDC, x + 10, y + 15, TEXT(&quot;Ein Text&quot;), 8);
	ReleaseDC(hWnd, hDC);
}
</code></pre>
<p>SetBkMode(TRANSPARENT) brauchst du. So sollte dein Code in etwa aussehen. Man soll das Default-Objekt am Ende des Zeichenvorgangs wieder auswählen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1265010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1265010</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 12 Apr 2007 23:20:58 GMT</pubDate></item><item><title><![CDATA[Reply to Hintergrund bei TextOut on Fri, 13 Apr 2007 11:04:45 GMT]]></title><description><![CDATA[<p>Ansatt den Brush so erstellen empfiehlt sich auch einfach:</p>
<pre><code class="language-cpp">HGDIOBJ hOldBrush = SelectObject(hDC, GetStockObject(BLACK_BRUSH));
</code></pre>
<p>Den muss man nämlich nicht mit DeleteObject löschen (aber man sollte den alten zurück-selektioeren.).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1265224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1265224</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Fri, 13 Apr 2007 11:04:45 GMT</pubDate></item></channel></rss>