<?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[Fehler in eigendefinierter Klasse]]></title><description><![CDATA[<p>Also ich hab hier meine eigene Klasse:</p>
<pre><code class="language-cpp">class FallingObject{
public:
FallingObject(int XLeft, int YTop, int XRight, int YBottom, TForm *DieForm, LoadingMethod, AnsiString, unsigned int);
~FallingObject();

void LoadPicFromFile(AnsiString);
void LoadPicFromResource(unsigned int,AnsiString);

private:
int itsCurrXLeft;
int itsCurrYTop;
int itsCurrXRight;
int itsCurrYBottom;
TForm * itsForm;
Graphics::TBitmap *itsBitmap;
bool itsShaking;
};

FallingObject::FallingObject(int XLeft, int YTop, int XRight, int YBottom, TForm *DieForm, LoadingMethod Load, AnsiString FileResName, unsigned int Instance ){
itsCurrXLeft   = XLeft;
itsCurrYTop    = YTop;
itsCurrXRight  = XRight;
itsCurrYBottom = YBottom;

itsBitmap = new Graphics::TBitmap();
itsForm = DieForm;
if ( Load == RES ){
        this-&gt;LoadPicFromResource(Instance,FileResName);
        }else{
        this-&gt;LoadPicFromFile(FileResName);
        }
itsForm-&gt;Canvas-&gt;StretchDraw(Rect(itsCurrXLeft,itsCurrYTop,itsCurrXRight,itsCurrYBottom),itsBitmap);
}

FallingObject::~FallingObject(){
delete itsBitmap;

}

void FallingObject::LoadPicFromFile(AnsiString Filename){
itsBitmap-&gt;LoadFromFile(Filename);
}

void FallingObject::LoadPicFromResource(unsigned int Instance,AnsiString Resname){
itsBitmap-&gt;LoadFromResourceName(Instance,Resname);
}
</code></pre>
<p>so. jetzt ruf ich den konstruktor auf und hab das problem das er es zwar ausführt. allerdings kein bild zustande kommt.</p>
<p>( So sieht mein aufruf aus.</p>
<pre><code class="language-cpp">FallingObject Baellchen(100,100,200,300,Form1,RES,&quot;Blau&quot;,(int)HInstance);
</code></pre>
<p>)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206185/fehler-in-eigendefinierter-klasse</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 01:26:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206185.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 Feb 2008 21:37:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler in eigendefinierter Klasse on Thu, 21 Feb 2008 21:37:00 GMT]]></title><description><![CDATA[<p>Also ich hab hier meine eigene Klasse:</p>
<pre><code class="language-cpp">class FallingObject{
public:
FallingObject(int XLeft, int YTop, int XRight, int YBottom, TForm *DieForm, LoadingMethod, AnsiString, unsigned int);
~FallingObject();

void LoadPicFromFile(AnsiString);
void LoadPicFromResource(unsigned int,AnsiString);

private:
int itsCurrXLeft;
int itsCurrYTop;
int itsCurrXRight;
int itsCurrYBottom;
TForm * itsForm;
Graphics::TBitmap *itsBitmap;
bool itsShaking;
};

FallingObject::FallingObject(int XLeft, int YTop, int XRight, int YBottom, TForm *DieForm, LoadingMethod Load, AnsiString FileResName, unsigned int Instance ){
itsCurrXLeft   = XLeft;
itsCurrYTop    = YTop;
itsCurrXRight  = XRight;
itsCurrYBottom = YBottom;

itsBitmap = new Graphics::TBitmap();
itsForm = DieForm;
if ( Load == RES ){
        this-&gt;LoadPicFromResource(Instance,FileResName);
        }else{
        this-&gt;LoadPicFromFile(FileResName);
        }
itsForm-&gt;Canvas-&gt;StretchDraw(Rect(itsCurrXLeft,itsCurrYTop,itsCurrXRight,itsCurrYBottom),itsBitmap);
}

FallingObject::~FallingObject(){
delete itsBitmap;

}

void FallingObject::LoadPicFromFile(AnsiString Filename){
itsBitmap-&gt;LoadFromFile(Filename);
}

void FallingObject::LoadPicFromResource(unsigned int Instance,AnsiString Resname){
itsBitmap-&gt;LoadFromResourceName(Instance,Resname);
}
</code></pre>
<p>so. jetzt ruf ich den konstruktor auf und hab das problem das er es zwar ausführt. allerdings kein bild zustande kommt.</p>
<p>( So sieht mein aufruf aus.</p>
<pre><code class="language-cpp">FallingObject Baellchen(100,100,200,300,Form1,RES,&quot;Blau&quot;,(int)HInstance);
</code></pre>
<p>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460597</guid><dc:creator><![CDATA[SomeWhatCool]]></dc:creator><pubDate>Thu, 21 Feb 2008 21:37:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in eigendefinierter Klasse on Thu, 21 Feb 2008 21:49:20 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>*Korrektur*<br />
Hatte das LoadFromFile nicht gesehen</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460606</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460606</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 21 Feb 2008 21:49:20 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in eigendefinierter Klasse on Thu, 21 Feb 2008 21:49:03 GMT]]></title><description><![CDATA[<p>Das muss man zuweisen oO? ...</p>
<p>Danke, werd mal suchen wie mans macht und das dann ausprobieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460607</guid><dc:creator><![CDATA[SomeWhatCool]]></dc:creator><pubDate>Thu, 21 Feb 2008 21:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in eigendefinierter Klasse on Thu, 21 Feb 2008 21:58:55 GMT]]></title><description><![CDATA[<p>Hm, also ich schreibe jetzt zwar ne größe rein, mit den properites Widht und Height aber im endeffekt ändert es nicht viel und es wundert mich recht stark da es schon mal geklapt hat ohne das ich ne größe spezifizieren musste ( war halt noch nicht mit der klasse ) hab ich da auch mit loadres. geladen und dann halt mit stretchdraw :|</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460612</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460612</guid><dc:creator><![CDATA[SomeWhatCool]]></dc:creator><pubDate>Thu, 21 Feb 2008 21:58:55 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in eigendefinierter Klasse on Thu, 21 Feb 2008 22:15:55 GMT]]></title><description><![CDATA[<p>Okay habs raus, lag daran das ich das ganze im TForm Konstruktor hatte.</p>
<p>und vor allem kein repaint drinne.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1460621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1460621</guid><dc:creator><![CDATA[SomeWhatCool]]></dc:creator><pubDate>Thu, 21 Feb 2008 22:15:55 GMT</pubDate></item></channel></rss>