<?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-&amp;gt;Draw... Problem]]></title><description><![CDATA[<p>Hallo Cracks<br />
Ich habe ein Form mit einem TImage erstellt.<br />
Laut BCB 5-Hilfe müsste ich mit der Methode Draw() das Bild<br />
auf die Canvas des Forms &quot;malen&quot; können:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
Image1-&gt;Visible=false;
Image1-&gt;Picture-&gt;LoadFromFile(&quot;C:\\Mein_Bild.jpg&quot;);
Form1-&gt;Canvas-&gt;Draw(0,0,Image1-&gt;Picture-&gt;Graphic);
}
//---------------------------------------------------------------------------
</code></pre>
<p>Es kommt keine Fehlermeldung aber auch kein Bild.<br />
Mit</p>
<pre><code class="language-cpp">Image1-&gt;Visible=true;
</code></pre>
<p>sehe ich das Bild zwar, aber ich kann es nicht auf die Canvas &quot;malen&quot;.<br />
Ich möchte das Bild an verschiedene Stellen des Forms kopieren.</p>
<p>Kann mir jemand auf die Sprünge helfen?<br />
Danke</p>
<p>wNw</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146908/canvas-gt-draw-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 04:21:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146908.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 May 2006 21:12:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Canvas-&amp;gt;Draw... Problem on Thu, 11 May 2006 21:12:44 GMT]]></title><description><![CDATA[<p>Hallo Cracks<br />
Ich habe ein Form mit einem TImage erstellt.<br />
Laut BCB 5-Hilfe müsste ich mit der Methode Draw() das Bild<br />
auf die Canvas des Forms &quot;malen&quot; können:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
Image1-&gt;Visible=false;
Image1-&gt;Picture-&gt;LoadFromFile(&quot;C:\\Mein_Bild.jpg&quot;);
Form1-&gt;Canvas-&gt;Draw(0,0,Image1-&gt;Picture-&gt;Graphic);
}
//---------------------------------------------------------------------------
</code></pre>
<p>Es kommt keine Fehlermeldung aber auch kein Bild.<br />
Mit</p>
<pre><code class="language-cpp">Image1-&gt;Visible=true;
</code></pre>
<p>sehe ich das Bild zwar, aber ich kann es nicht auf die Canvas &quot;malen&quot;.<br />
Ich möchte das Bild an verschiedene Stellen des Forms kopieren.</p>
<p>Kann mir jemand auf die Sprünge helfen?<br />
Danke</p>
<p>wNw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1056050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1056050</guid><dc:creator><![CDATA[wNw]]></dc:creator><pubDate>Thu, 11 May 2006 21:12:44 GMT</pubDate></item><item><title><![CDATA[Reply to Canvas-&amp;gt;Draw... Problem on Thu, 11 May 2006 21:16:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>der Konstruktor ist dafür nicht die richtige Stelle. Denn zu diesem zeitpunkt wird das Form noch gar nicht angezeigt. Und wenn dann durch Show() das Form angezeigt wird, verfällt die Ausgabe. Denn jede Operation auf Canvas ist flüchtig, also wird durch hjede nächste Operation an der gleichen Stelle überschrieben.</p>
<p>Nimm den OnPaint-Event, um deine Bitmaps (wieder) zu zeichnen.<br />
Übrigens, statt einem unsichtbaren TImage ist ein manuell erstellten TBitmap als Member des Forms eleganter.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1056051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1056051</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 11 May 2006 21:16:19 GMT</pubDate></item><item><title><![CDATA[Reply to Canvas-&amp;gt;Draw... Problem on Thu, 11 May 2006 21:23:14 GMT]]></title><description><![CDATA[<p>Danke für die schnelle Hilfe um diese Zeit, akari.<br />
Das wirds sein...<br />
Ist ja auch logisch...</p>
<p><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="👍"
    /><br />
Danke<br />
wNw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1056056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1056056</guid><dc:creator><![CDATA[wNw]]></dc:creator><pubDate>Thu, 11 May 2006 21:23:14 GMT</pubDate></item></channel></rss>