<?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[mein Graphics::TBitmap will nicht in mein Image1]]></title><description><![CDATA[<p>Hier 'ne Kurzfassung von meinem Problem, ich habe 'nen Bitmap aus 'ner Funktion als Rückgabewert, übergebe diesem einem Image, aber das Image bleibt leer. Der Rückgabewert bildet sich aus einem Feld von einem DataSet und kommt aus einer SQL-Datenbank.<br />
Mein Problem, mein Image1 bleibt nach'm Klick bzw. taucht nicht im Image auf. Was mir beim Debuggen aufgefallen ist und ich merkwürdig finde, ist das mein TBitmap 'nen Canvas mit dem Wert &quot;Null&quot; hat, weiß aber nicht ob das eine Rolle spielt. Von daher dachte ich auch erst bzw. denke ich immer noch, das es an der Übergabe liegt.<br />
Das Bitmap ist in der Datenbank auch vorhanden, das habe ich vorher selbst hinein gespeichert mit einer anderen Funktion und ist aufrufbar mit einem TDBImage.</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
        Image1-&gt;Picture-&gt;Bitmap-&gt;FreeImage();
        Image1-&gt;Picture-&gt;Bitmap = Frame1-&gt;Testing();
}
//---------------------------------------------------------------------------
</code></pre>
<pre><code class="language-cpp">Graphics::TBitmap *__fastcall TFrame1::Testing()
{
        ((TBlobField*)DataModule1-&gt;ADODSDataSet1-&gt;FieldByName(&quot;Abbildung&quot;))-&gt;SaveToStream(pStream);
        pBitmap-&gt;LoadFromStream(pStream);
        return pBitmap;
}
</code></pre>
<p>und pBitmap / pStream sehen aus</p>
<pre><code class="language-cpp">class TFrame1 : public TFrame
{
__published:	// Von der IDE verwaltete Komponenten
private:	// Anwender-Deklarationen
        TMemoryStream *pStream;
        Graphics::TBitmap *pBitmap;
public:		// Anwender-Deklarationen
        __fastcall TFrame1(TComponent* Owner);
        Graphics::TBitmap *__fastcall Testing();
};
</code></pre>
<p>Kann mir einer helfen? Wäre sehr dankbar <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Come back soon<br />
Vo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203700/mein-graphics-tbitmap-will-nicht-in-mein-image1</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 12:34:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203700.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Jan 2008 13:26:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mein Graphics::TBitmap will nicht in mein Image1 on Fri, 25 Jan 2008 13:29:51 GMT]]></title><description><![CDATA[<p>Hier 'ne Kurzfassung von meinem Problem, ich habe 'nen Bitmap aus 'ner Funktion als Rückgabewert, übergebe diesem einem Image, aber das Image bleibt leer. Der Rückgabewert bildet sich aus einem Feld von einem DataSet und kommt aus einer SQL-Datenbank.<br />
Mein Problem, mein Image1 bleibt nach'm Klick bzw. taucht nicht im Image auf. Was mir beim Debuggen aufgefallen ist und ich merkwürdig finde, ist das mein TBitmap 'nen Canvas mit dem Wert &quot;Null&quot; hat, weiß aber nicht ob das eine Rolle spielt. Von daher dachte ich auch erst bzw. denke ich immer noch, das es an der Übergabe liegt.<br />
Das Bitmap ist in der Datenbank auch vorhanden, das habe ich vorher selbst hinein gespeichert mit einer anderen Funktion und ist aufrufbar mit einem TDBImage.</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
        Image1-&gt;Picture-&gt;Bitmap-&gt;FreeImage();
        Image1-&gt;Picture-&gt;Bitmap = Frame1-&gt;Testing();
}
//---------------------------------------------------------------------------
</code></pre>
<pre><code class="language-cpp">Graphics::TBitmap *__fastcall TFrame1::Testing()
{
        ((TBlobField*)DataModule1-&gt;ADODSDataSet1-&gt;FieldByName(&quot;Abbildung&quot;))-&gt;SaveToStream(pStream);
        pBitmap-&gt;LoadFromStream(pStream);
        return pBitmap;
}
</code></pre>
<p>und pBitmap / pStream sehen aus</p>
<pre><code class="language-cpp">class TFrame1 : public TFrame
{
__published:	// Von der IDE verwaltete Komponenten
private:	// Anwender-Deklarationen
        TMemoryStream *pStream;
        Graphics::TBitmap *pBitmap;
public:		// Anwender-Deklarationen
        __fastcall TFrame1(TComponent* Owner);
        Graphics::TBitmap *__fastcall Testing();
};
</code></pre>
<p>Kann mir einer helfen? Wäre sehr dankbar <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Come back soon<br />
Vo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1443434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1443434</guid><dc:creator><![CDATA[Vorrax]]></dc:creator><pubDate>Fri, 25 Jan 2008 13:29:51 GMT</pubDate></item><item><title><![CDATA[Reply to mein Graphics::TBitmap will nicht in mein Image1 on Fri, 25 Jan 2008 13:47:53 GMT]]></title><description><![CDATA[<p>Zeigt mir ein Bild.</p>
<pre><code class="language-cpp">Image1-&gt;Picture-&gt;Bitmap-&gt;FreeImage();
        Graphics::TBitmap *bmp = new Graphics::TBitmap();
        OpenPictureDialog1-&gt;Execute();
        bmp-&gt;LoadFromFile(OpenPictureDialog1-&gt;FileName);
        Image1-&gt;Picture-&gt;Bitmap = bmp;
        delete bmp;
</code></pre>
<p>Zeigt mir ein leeres Bild.</p>
<pre><code class="language-cpp">Image1-&gt;Picture-&gt;Bitmap-&gt;FreeImage();
        Graphics::TBitmap *bmp = new Graphics::TBitmap();
        TMemoryStream *stream = new TMemoryStream();
        OpenPictureDialog1-&gt;Execute();
        bmp-&gt;LoadFromFile(OpenPictureDialog1-&gt;FileName);
        bmp-&gt;SaveToStream(stream);
        bmp-&gt;FreeImage();
        bmp-&gt;LoadFromStream(stream);
        Image1-&gt;Picture-&gt;Bitmap = bmp;
        delete bmp;
        delete stream;
</code></pre>
<p>Hat vielleicht jemand eine Alternative ein Bitmap aus einem DataSet zu laden, da es ja anscheinend ein Problem mit meinem TMemoryStream gibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1443454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1443454</guid><dc:creator><![CDATA[Vorrax]]></dc:creator><pubDate>Fri, 25 Jan 2008 13:47:53 GMT</pubDate></item><item><title><![CDATA[Reply to mein Graphics::TBitmap will nicht in mein Image1 on Fri, 25 Jan 2008 13:58:31 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Das Problem dürfte sein das du nach dem Laden des Bildes in den Stream und vor dem Auslesen des Bildes aus dem Stream den Stream erst zurücksetzen must, mit desen Methode Seek.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1443462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1443462</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 25 Jan 2008 13:58:31 GMT</pubDate></item><item><title><![CDATA[Reply to mein Graphics::TBitmap will nicht in mein Image1 on Fri, 25 Jan 2008 14:04:44 GMT]]></title><description><![CDATA[<p>akari? Ich liebe dich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Danke für die schnelle Antwort, war mehr als hilfreich, dank des</p>
<pre><code class="language-cpp">stream-&gt;Seek(0, soFromBeginning);
</code></pre>
<p>funktioniert es, und ich kann endlich mit meiner Bildbearbeitung fortsetzen.</p>
<p>Möge die Macht mit Euch sein...<br />
Vo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1443467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1443467</guid><dc:creator><![CDATA[Vorrax]]></dc:creator><pubDate>Fri, 25 Jan 2008 14:04:44 GMT</pubDate></item><item><title><![CDATA[Reply to mein Graphics::TBitmap will nicht in mein Image1 on Mon, 28 Jan 2008 09:49:12 GMT]]></title><description><![CDATA[<p>stream-&gt;Position = 0; erfüllt den gleiche Zweck.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1444882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1444882</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 28 Jan 2008 09:49:12 GMT</pubDate></item></channel></rss>