<?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[Probleme mit Draw]]></title><description><![CDATA[<p>Hallo Cracks!</p>
<p>Ich benutze BCB5 und habe folgendes Problem:<br />
Ich möchte,das ein zur Laufzeit erzeugtes und geladenes TPicture direkt auf dem Form ausgegeben wird.<br />
Müsste doch mit Draw gehen, oder?<br />
Habe bisher diesen Code und wundere mich das ich weder Bild,<br />
noch Fehlermeldung bekomme:</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;
TPicture *Bild;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Bild=new TPicture();
Bild-&gt;LoadFromFile(&quot;C:\\Eigene Dateien\\Bilder\\snap\\snap000001.jpg&quot;);
Form1-&gt;Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
delete Bild;
}
//---------------------------------------------------------------------------
</code></pre>
<p>Warscheinlich ein dummer Fehler...<br />
Hoffe jemand kann mir helfen!</p>
<p><strong>Danke!</strong></p>
<p>WerdNochWahnsinnig</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/119022/probleme-mit-draw</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Jul 2026 02:05:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/119022.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Aug 2005 16:57:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 16:57:30 GMT]]></title><description><![CDATA[<p>Hallo Cracks!</p>
<p>Ich benutze BCB5 und habe folgendes Problem:<br />
Ich möchte,das ein zur Laufzeit erzeugtes und geladenes TPicture direkt auf dem Form ausgegeben wird.<br />
Müsste doch mit Draw gehen, oder?<br />
Habe bisher diesen Code und wundere mich das ich weder Bild,<br />
noch Fehlermeldung bekomme:</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;
TPicture *Bild;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Bild=new TPicture();
Bild-&gt;LoadFromFile(&quot;C:\\Eigene Dateien\\Bilder\\snap\\snap000001.jpg&quot;);
Form1-&gt;Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
delete Bild;
}
//---------------------------------------------------------------------------
</code></pre>
<p>Warscheinlich ein dummer Fehler...<br />
Hoffe jemand kann mir helfen!</p>
<p><strong>Danke!</strong></p>
<p>WerdNochWahnsinnig</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859180</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Fri, 26 Aug 2005 16:57:30 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:24:07 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das solltest du etwas anders machen:<br />
im Header :</p>
<pre><code class="language-cpp">...
private :

  TBitmap *Bild; // Zwischenspeicher für Bild
public :
...

  __fastcall ~TForm1(); // zusätzlicher Destruktor
</code></pre>
<p>in der Implementation :</p>
<pre><code class="language-cpp">__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  Bild = new Graphics::TBitmap();
  Bild-&gt;LoadFromFile(&quot;C:\\Eigene Dateien\\Bilder\\snap\\snap000001.jpg&quot;);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormPaint(TObject *Sender) // anstatt Create!
{
Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::~TForm1()
{
delete Bild;
}
//---------------------------------------------------------------------------
</code></pre>
<p>/Edit : und warum nimmst du dafür nicht gleich ein regulares TImage auf der Form?</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859200</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:24:07 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:43:46 GMT]]></title><description><![CDATA[<p>Danke für die schnelle Hilfe!</p>
<p>Hab den Code jetzt so verändert:<br />
Header:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
#include &lt;jpeg.hpp&gt;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &amp;Action);
        void __fastcall FormPaint(TObject *Sender);
private:	// Anwender-Deklarationen
TBitmap *Bild;
public:		// Anwender-Deklarationen
        __fastcall TForm1(TComponent* Owner);
        __fastcall ~TForm1();
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Und :</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;
//TPicture *Bild;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
delete Bild;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);

}
//---------------------------------------------------------------------------
</code></pre>
<p>Doch er wirft mir folgende Fehlermeldungen raus:</p>
<blockquote>
<p>[C++ Fehler] Unit1.h(20): E2015 Mehrdeutigkeit zwischen 'TBitmap' und 'Windows::TBitmap'<br />
[C++ Fehler] Unit1.cpp(22): E2316 'Graphic' ist kein Element von 'TBitmap'<br />
[C++ Fehler] Unit1.cpp(32): E2316 'Graphic' ist kein Element von 'TBitmap'</p>
</blockquote>
<p>Warum???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859223</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:43:46 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:51:55 GMT]]></title><description><![CDATA[<p>Sorry,akari<br />
Die Sache hab ich natürlich rausgenommen:</p>
<pre><code class="language-cpp">void __fastcall TForm1::FormCreate(TObject *Sender)
{
Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
</code></pre>
<p>Mein Fehler jetzt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859233</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:51:55 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:54:17 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Hab im Header mich verschrieben, es muß so aussehen :</p>
<pre><code class="language-cpp">Graphics::TBitmap *Bild;
</code></pre>
<p>und vergiß die Zeilen im Konstruktor und Destruktor nicht. Nimm das OnClose und das OnCreate raus.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859234</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859234</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:54:17 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:54:03 GMT]]></title><description><![CDATA[<p>Geht aber immer noch nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859236</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859236</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:54:03 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Fri, 26 Aug 2005 17:56:24 GMT]]></title><description><![CDATA[<p>brauche ein Weilchen zum testen...</p>
<p>Danke, akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859238</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Fri, 26 Aug 2005 17:56:24 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Draw on Sun, 28 Aug 2005 16:24:23 GMT]]></title><description><![CDATA[<p>Hallo akari<br />
Hat ja doch noch geklappt:</p>
<p>Header:</p>
<pre><code class="language-cpp">#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
#include &lt;jpeg.hpp&gt;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
        void __fastcall FormClose(TObject *Sender, TCloseAction &amp;Action);
        void __fastcall FormPaint(TObject *Sender);
private:	// Anwender-Deklarationen
Graphics::TPicture *Bild;
public:		// Anwender-Deklarationen
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Unit1:</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;
//TPicture *Bild;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
Bild = new Graphics::TPicture();
Bild-&gt;LoadFromFile(&quot;C:\\Eigene Dateien\\Bilder\\snap\\snap000001.jpg&quot;);

}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
delete Bild;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
Canvas-&gt;Draw(0,0,Bild-&gt;Graphic);
}
</code></pre>
<p><strong>Danke nochmal, akari !</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/post/860169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/860169</guid><dc:creator><![CDATA[WerdNochWahnsinnig]]></dc:creator><pubDate>Sun, 28 Aug 2005 16:24:23 GMT</pubDate></item></channel></rss>