<?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[Canvas auf TPanel]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte gerne den Canvas von TPanel nutzen. Dazu habe ich auch schon einiges versucht und den Hinweis hier im Forum gefunden, die Property Canvas public zu machen. Aber mit dem BCB 6.0 wird der Code zwar korrekt compiliert, aber auf dem Panel wird nichts angezeigt.</p>
<pre><code>class TMyPanel : public TPanel
{
public:
    __fastcall TMyPanel(TComponent* Owner);

    __property Canvas;
};
</code></pre>
<pre><code>__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    TMyPanel *p = new TMyPanel(Owner);
    p-&gt;Parent = this;
    p-&gt;Canvas-&gt;Pen-&gt;Color = clRed;
    p-&gt;Canvas-&gt;Pen-&gt;Width = 2;
    p-&gt;Canvas-&gt;Ellipse(5,5,20,20);

    TImage *i = new TImage(Owner);
    i-&gt;Parent = this;
    i-&gt;Top = 50;
    i-&gt;Left = 100;
    i-&gt;Canvas-&gt;Pen-&gt;Color = clRed;
    i-&gt;Canvas-&gt;Pen-&gt;Width = 2;
    i-&gt;Canvas-&gt;Ellipse(5,5,60,30);
}
</code></pre>
<p>Ein Test mit einem TImage funktioniert wunderbar.<br />
Wo liegt der Fehler beim TPanel, was ist falsch, was habe ich vergessen?</p>
<p>Danke für eure Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/128480/canvas-auf-tpanel</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 11:26:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/128480.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 Dec 2005 01:22:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Canvas auf TPanel on Sun, 04 Dec 2005 01:22:11 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte gerne den Canvas von TPanel nutzen. Dazu habe ich auch schon einiges versucht und den Hinweis hier im Forum gefunden, die Property Canvas public zu machen. Aber mit dem BCB 6.0 wird der Code zwar korrekt compiliert, aber auf dem Panel wird nichts angezeigt.</p>
<pre><code>class TMyPanel : public TPanel
{
public:
    __fastcall TMyPanel(TComponent* Owner);

    __property Canvas;
};
</code></pre>
<pre><code>__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    TMyPanel *p = new TMyPanel(Owner);
    p-&gt;Parent = this;
    p-&gt;Canvas-&gt;Pen-&gt;Color = clRed;
    p-&gt;Canvas-&gt;Pen-&gt;Width = 2;
    p-&gt;Canvas-&gt;Ellipse(5,5,20,20);

    TImage *i = new TImage(Owner);
    i-&gt;Parent = this;
    i-&gt;Top = 50;
    i-&gt;Left = 100;
    i-&gt;Canvas-&gt;Pen-&gt;Color = clRed;
    i-&gt;Canvas-&gt;Pen-&gt;Width = 2;
    i-&gt;Canvas-&gt;Ellipse(5,5,60,30);
}
</code></pre>
<p>Ein Test mit einem TImage funktioniert wunderbar.<br />
Wo liegt der Fehler beim TPanel, was ist falsch, was habe ich vergessen?</p>
<p>Danke für eure Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933620</guid><dc:creator><![CDATA[SomeOne]]></dc:creator><pubDate>Sun, 04 Dec 2005 01:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to Canvas auf TPanel on Sun, 04 Dec 2005 11:13:44 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>wenn der Konstruktor des Panels ausgeführt wird, wird das Panel auch noch gar nicht dargestellt. Folglich werden alle Zeichenoperationen, die du im Konstruktor ausfürhst, ignoriert und zusätzlich noch überzeichnet, wenn das Panel dann wirklich durch das zuweisen von Parent und das Anzeigen des Forms angezeigt wird.</p>
<p>Du must die methode Paint() ableiten und dort deine Zeichenoperationen ausführen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933728</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 04 Dec 2005 11:13:44 GMT</pubDate></item><item><title><![CDATA[Reply to Canvas auf TPanel on Sun, 04 Dec 2005 12:47:17 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Du must die methode Paint() ableiten und dort deine Zeichenoperationen ausführen.</p>
</blockquote>
<p>That's it.<br />
Herzlichen Dank für die schnelle Hilfe.</p>
<p>bis denn<br />
SomeOne</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933758</guid><dc:creator><![CDATA[SomeOne]]></dc:creator><pubDate>Sun, 04 Dec 2005 12:47:17 GMT</pubDate></item></channel></rss>