<?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[Länge eines Textes in Pixel rausfinden in abhängigkeit von CFont?]]></title><description><![CDATA[<p>habe Folgenden Code:</p>
<p>// Schrift für Skala Bezeichung<br />
CFont l_new_font, *l_old_font;</p>
<pre><code class="language-cpp">l_new_font.CreateFont(30, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, 0, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, &quot;Times New Roman&quot;);
		// Schrift zuweisen
		l_old_font = oDC.SelectObject(&amp;l_new_font); 

		// Texte Zeichnen /////////////////////////////////////

		oDC.TextOut(5, iR+(iUnitY*i)+1, &quot;Hallo&quot;		

		// Alte Schrift wieder zurückholen
		oDC.SelectObject(l_old_font);

		// Schrift löschen
		l_new_font.DeleteObject();
</code></pre>
<p>Wie kann ich nun die Länge der Pixel des TExtes &quot;HAllo&quot; in abhängigkeit mit der Schrift Größe etc. von CFont ermitteln??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/160013/länge-eines-textes-in-pixel-rausfinden-in-abhängigkeit-von-cfont</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Jul 2026 09:21:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/160013.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 Sep 2006 05:26:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Länge eines Textes in Pixel rausfinden in abhängigkeit von CFont? on Thu, 21 Sep 2006 05:26:07 GMT]]></title><description><![CDATA[<p>habe Folgenden Code:</p>
<p>// Schrift für Skala Bezeichung<br />
CFont l_new_font, *l_old_font;</p>
<pre><code class="language-cpp">l_new_font.CreateFont(30, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, 0, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, &quot;Times New Roman&quot;);
		// Schrift zuweisen
		l_old_font = oDC.SelectObject(&amp;l_new_font); 

		// Texte Zeichnen /////////////////////////////////////

		oDC.TextOut(5, iR+(iUnitY*i)+1, &quot;Hallo&quot;		

		// Alte Schrift wieder zurückholen
		oDC.SelectObject(l_old_font);

		// Schrift löschen
		l_new_font.DeleteObject();
</code></pre>
<p>Wie kann ich nun die Länge der Pixel des TExtes &quot;HAllo&quot; in abhängigkeit mit der Schrift Größe etc. von CFont ermitteln??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141518</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141518</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Thu, 21 Sep 2006 05:26:07 GMT</pubDate></item><item><title><![CDATA[Reply to Länge eines Textes in Pixel rausfinden in abhängigkeit von CFont? on Thu, 21 Sep 2006 05:35:21 GMT]]></title><description><![CDATA[<p>GetTextExtent oder so ähnlich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141520</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 21 Sep 2006 05:35:21 GMT</pubDate></item><item><title><![CDATA[Reply to Länge eines Textes in Pixel rausfinden in abhängigkeit von CFont? on Thu, 21 Sep 2006 07:30:06 GMT]]></title><description><![CDATA[<p>afaik kannst du TextOut mit einem Flag aufrufen, so dass der Text nicht gezeichnet wird, aber der benötigte Platz wird als Rechteck zurückgegeben.</p>
<p>Kuck mal in der Hilfe.</p>
<p>--Edit--<br />
Oder DrawText ?? Eins von beiden jedenfalls!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141580</guid><dc:creator><![CDATA[electron]]></dc:creator><pubDate>Thu, 21 Sep 2006 07:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to Länge eines Textes in Pixel rausfinden in abhängigkeit von CFont? on Thu, 21 Sep 2006 09:15:17 GMT]]></title><description><![CDATA[<p>Vielleicht kannst du auch was mit den Funktionen hier anfangen ... die hab ich mal irgendwann benutzt.</p>
<p>GetTextMetrics(...)<br />
GetTextExtent(...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141655</guid><dc:creator><![CDATA[Mr.Yellow]]></dc:creator><pubDate>Thu, 21 Sep 2006 09:15:17 GMT</pubDate></item></channel></rss>