<?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[TRect Größe]]></title><description><![CDATA[<p>hallo.<br />
im forum habe ich einen code gefunden um ein zeichen um winkel x drehen zu können. ich verwende dafür die scriftart wingdings und einen pfeil. schon im damaligen thread (<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-168885-and-highlight-is-pfeil.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-168885-and-highlight-is-pfeil.html</a>) war die frage, warum ab einem bestimmten winkel nichts mehr zu sehen ist.</p>
<p>Jansen antwortete:<br />
&quot;Stell dir den schrägen Text als Diagonale des zu übergebenden Rects vor.<br />
Entsprechend gross muss letzteres definiert werden (mindestens).&quot;</p>
<p>ich konnte das icht umsetzen und hab was gefummelt. nun bekomme ich zwar den pfeil immer angezeigt, aber halt nie an einer festen position. ich muss aber noch eine linie an den pfeil ranzeichnen.</p>
<pre><code class="language-cpp">void pfeil_text(char *str,int X, int Y, double Angle)
{
frmMain-&gt;Canvas-&gt;Brush-&gt;Color=clWhite;

int fontweight;
DWORD fontitalic, fontunderline, fontstrikeout;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsBold))
        fontweight = FW_BOLD;
else
        fontweight = FW_NORMAL;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsItalic))
        fontitalic = true;
else
        fontitalic = false;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsUnderline))
        fontunderline = true;
else
        fontunderline = false;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsStrikeOut))
        fontstrikeout = true;
else
        fontstrikeout = false;
HFONT hFont = CreateFont(frmMain-&gt;Canvas-&gt;Font-&gt;Height, 0, Angle*10, Angle*10, fontweight,
                fontitalic, fontunderline, fontstrikeout, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
                CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
                frmMain-&gt;Canvas-&gt;Font-&gt;Name.c_str());
SelectObject(frmMain-&gt;Canvas-&gt;Handle, hFont);
// HIER STAND EIGENTLICH:
// TRect R(X,Y,X+frmMain-&gt;Canvas-&gt;TextWidth(str),Y+frmMain-&gt;Canvas-&gt;TextHeight(str)); 

// HIER NUN MEINE ABWANDLUNG:
TRect R(X,Y,X+140,Y+140);
   if (Angle &gt;= 180)
   {
      X += 50;
      Y += 30;
   }
   else if (Angle &gt;= 145)
   {
      X += 15;
      Y += 30;
   }
   else if (Angle &gt;= 115)
   {
      X += 10;
      Y += StrToInt(frmMain-&gt;Edit1-&gt;Text);
   }
   else
      {
         Y += StrToInt(frmMain-&gt;Edit1-&gt;Text);
      }

frmMain-&gt;Canvas-&gt;TextRect(R, X, Y, str);
// MEIN TEIL ENDE
DeleteObject(hFont);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/193808/trect-größe</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 02:52:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193808.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 Sep 2007 10:00:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TRect Größe on Sun, 30 Sep 2007 10:00:49 GMT]]></title><description><![CDATA[<p>hallo.<br />
im forum habe ich einen code gefunden um ein zeichen um winkel x drehen zu können. ich verwende dafür die scriftart wingdings und einen pfeil. schon im damaligen thread (<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-168885-and-highlight-is-pfeil.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-168885-and-highlight-is-pfeil.html</a>) war die frage, warum ab einem bestimmten winkel nichts mehr zu sehen ist.</p>
<p>Jansen antwortete:<br />
&quot;Stell dir den schrägen Text als Diagonale des zu übergebenden Rects vor.<br />
Entsprechend gross muss letzteres definiert werden (mindestens).&quot;</p>
<p>ich konnte das icht umsetzen und hab was gefummelt. nun bekomme ich zwar den pfeil immer angezeigt, aber halt nie an einer festen position. ich muss aber noch eine linie an den pfeil ranzeichnen.</p>
<pre><code class="language-cpp">void pfeil_text(char *str,int X, int Y, double Angle)
{
frmMain-&gt;Canvas-&gt;Brush-&gt;Color=clWhite;

int fontweight;
DWORD fontitalic, fontunderline, fontstrikeout;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsBold))
        fontweight = FW_BOLD;
else
        fontweight = FW_NORMAL;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsItalic))
        fontitalic = true;
else
        fontitalic = false;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsUnderline))
        fontunderline = true;
else
        fontunderline = false;
if(frmMain-&gt;Canvas-&gt;Font-&gt;Style.Contains(fsStrikeOut))
        fontstrikeout = true;
else
        fontstrikeout = false;
HFONT hFont = CreateFont(frmMain-&gt;Canvas-&gt;Font-&gt;Height, 0, Angle*10, Angle*10, fontweight,
                fontitalic, fontunderline, fontstrikeout, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
                CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
                frmMain-&gt;Canvas-&gt;Font-&gt;Name.c_str());
SelectObject(frmMain-&gt;Canvas-&gt;Handle, hFont);
// HIER STAND EIGENTLICH:
// TRect R(X,Y,X+frmMain-&gt;Canvas-&gt;TextWidth(str),Y+frmMain-&gt;Canvas-&gt;TextHeight(str)); 

// HIER NUN MEINE ABWANDLUNG:
TRect R(X,Y,X+140,Y+140);
   if (Angle &gt;= 180)
   {
      X += 50;
      Y += 30;
   }
   else if (Angle &gt;= 145)
   {
      X += 15;
      Y += 30;
   }
   else if (Angle &gt;= 115)
   {
      X += 10;
      Y += StrToInt(frmMain-&gt;Edit1-&gt;Text);
   }
   else
      {
         Y += StrToInt(frmMain-&gt;Edit1-&gt;Text);
      }

frmMain-&gt;Canvas-&gt;TextRect(R, X, Y, str);
// MEIN TEIL ENDE
DeleteObject(hFont);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1375218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375218</guid><dc:creator><![CDATA[dtp]]></dc:creator><pubDate>Sun, 30 Sep 2007 10:00:49 GMT</pubDate></item><item><title><![CDATA[Reply to TRect Größe on Sun, 30 Sep 2007 17:02:31 GMT]]></title><description><![CDATA[<p>dtp schrieb:</p>
<blockquote>
<p>nun bekomme ich zwar den pfeil immer angezeigt, aber halt nie an einer festen position. ich muss aber noch eine linie an den pfeil ranzeichnen.</p>
</blockquote>
<p>Falls du mit 'Pfeil' ein Zeichen aus dem WingDing-Font meinst: ist doch logisch, dass der Pfeilschaft je nach Drehung an einer anderen Stelle endet.<br />
Jedes Zeichen ist ein Rechteck, in dem bestimmte Punkte eingefärbt sind. Bei der Ausgabe im Winkel dreht sich das Rechteck um seine linke obere Ecke, und nicht etwa um einen bestimmten eingefärbten Punkt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375461</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 30 Sep 2007 17:02:31 GMT</pubDate></item><item><title><![CDATA[Reply to TRect Größe on Sun, 30 Sep 2007 21:14:47 GMT]]></title><description><![CDATA[<p>ja einverstanden, aber bei meinen größendefinitionen ist es eben mal unten links, dann wieder ganz oben usw.</p>
<p>mich hätte interessiert wie der andere anwender das umgebaut hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375597</guid><dc:creator><![CDATA[dtp]]></dc:creator><pubDate>Sun, 30 Sep 2007 21:14:47 GMT</pubDate></item><item><title><![CDATA[Reply to TRect Größe on Sun, 30 Sep 2007 21:17:57 GMT]]></title><description><![CDATA[<p>Der 'andere Anwender' hat offenbar den Pfeil selbst gezeichnet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375599</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 30 Sep 2007 21:17:57 GMT</pubDate></item><item><title><![CDATA[Reply to TRect Größe on Mon, 01 Oct 2007 07:45:44 GMT]]></title><description><![CDATA[<p>nö. hat er nicht. egal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375710</guid><dc:creator><![CDATA[dtp]]></dc:creator><pubDate>Mon, 01 Oct 2007 07:45:44 GMT</pubDate></item></channel></rss>