<?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[TImage anpassen]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich hab auf meiner Form ein TImage und lade da zur Laufzeit nacheinander verschiedene Bilder hinein.<br />
Ich hätte jetzt gerne, dass das Bild dem TImage Feld angepasst wird.<br />
Ich habe es schon mit Stretch probiert, aber dadurch wird ja (wie der Name schon sagt) das Bild eventuell verzerrt. Ich hab auch schon mit Align und Anchors rumgespielt, habe es aber noch nicht geschafft.</p>
<p>Kann mir bitte jemand helfen.</p>
<p>PS:Gibt es da vielleicht auch eine Möglichkeit Scollbars hinzuzufügen?</p>
<p>Kiki</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/159242/timage-anpassen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 16:07:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/159242.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Sep 2006 09:48:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 09:48:31 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich hab auf meiner Form ein TImage und lade da zur Laufzeit nacheinander verschiedene Bilder hinein.<br />
Ich hätte jetzt gerne, dass das Bild dem TImage Feld angepasst wird.<br />
Ich habe es schon mit Stretch probiert, aber dadurch wird ja (wie der Name schon sagt) das Bild eventuell verzerrt. Ich hab auch schon mit Align und Anchors rumgespielt, habe es aber noch nicht geschafft.</p>
<p>Kann mir bitte jemand helfen.</p>
<p>PS:Gibt es da vielleicht auch eine Möglichkeit Scollbars hinzuzufügen?</p>
<p>Kiki</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136464</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 09:48:31 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 09:55:51 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie soll denn das Bild dem Image angepasst werden, wenn dir Stretch nicht zusagt?</p>
<p>Scrollbars erreichst du einfach, indem du das TImage in ein TScrollBox legst und bei dem TImage Align = alClient einstellst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136469</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 13 Sep 2006 09:55:51 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 10:17:43 GMT]]></title><description><![CDATA[<p>Proportional=true;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136484</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136484</guid><dc:creator><![CDATA[Morris Szyslak]]></dc:creator><pubDate>Wed, 13 Sep 2006 10:17:43 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 10:49:52 GMT]]></title><description><![CDATA[<p>@Morris Szyslak: Wo befindet sich dies &quot;Proportional&quot; Variable?<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a>: Danke, werde ich gleich mal versuchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136491</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 10:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 10:52:13 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a>: Also das mit der Scollbox funktiniert leider nicht. Ich denke fast, dass es daran liegt, dass ich die Bilder erst zur Laufzeit in das Image lade.</p>
<p>Wenn ich das Image nicht auf alClient setze und dann in der ScollBox verschiebe könne ich mir die ScollBalken erzwingen, sonst habe ich sie aber leider nicht. Und wenn ich dann zur Laufzeit ein Bild lade habe ich wieder nur den rechten oberen Teil. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Hoffe ich habe mich verständlich ausgedrückt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136510</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136510</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 10:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:04:31 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das mit der Scrollbox geht schon, du must nur nach dem Laden des neuen Bitmaps noch die Eigenschaften <em>TImage::Heigth</em> und <em>TImage::Width</em> mit den Werten des neuen Bitmaps aktualisieren (<em>TImage::Picture::Bitmap::Height</em> bzw <em>::Width</em>)</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136523</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:04:31 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:35:22 GMT]]></title><description><![CDATA[<p>So was hab ich mir schon gedacht und bereits ein bisschen rum probiert.</p>
<p>Also ich hab jetzt mal folgenden Code:</p>
<pre><code class="language-cpp">Image-&gt;Picture-&gt;LoadFromFile(bild);
Image-&gt;Height=Image-&gt;Picture-&gt;Graphic-&gt;Height;
Image-&gt;Width=Image-&gt;Picture-&gt;Graphic-&gt;Width;
</code></pre>
<p>...ich dachte ich muss Graphic nehmen da es sich bei meinem Bild um ein *.jpg Datei handelt. (habe es aber auch mit bitmap probiert)<br />
Leider funktioniert es immernoch nicht. Ich habe auch ein Image-&gt;Update() gemacht, es passiert aber leider immernoch nichts.</p>
<p>Muss ich in der ScollBox vielleicht noch irgendeine Einstellung machen?</p>
<p>EDIT1:<br />
Ich habe den Fehler gefunden, kann ihn aber leider nicht beheben.<br />
Also ich kann die zwei Variablen Image-&gt;Width bz. Height nicht größer machen, wie meine ScollBox ist!?</p>
<p>Edit2:<br />
Habe den Fehler behoben. Man darf im Image die Eigenschaft alClient nicht setzen, da sonst die Breite und höhe automatisch gesetzet sind!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136540</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:35:09 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>sorry das liegt an der Align-Einstellung. Die muß bei dieser Sache nun doch alNone sein (bzw alles außer alClient).</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136550</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:35:09 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:38:05 GMT]]></title><description><![CDATA[<p>jo habe ich auch soeben bemerkt.<br />
Kannst du mir vielleicht auch sagen wo ich diese Proportional-Variable finden kann. (Tipp von Morris Szyslak)<br />
Glaube fast, dass mir sowas lieber wäre.<br />
Also dass ich immer dieselbe Größe habe und dass das Bild dann proportional hineinverkleinert bzw. vergrößert wird. Also nicht wie bei der Option Stretch verzerrt wird.</p>
<p>Kiki</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136554</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:38:05 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:43:23 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>zumindestens im Builder 5 gibts das (noch) nicht.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136561</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:43:23 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 11:54:56 GMT]]></title><description><![CDATA[<p>ah ok. Trotzdem danke für die Info.<br />
Und danke für die Hilfe mit der ScollBox.</p>
<p>THX Kiki</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136567</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Wed, 13 Sep 2006 11:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 12:25:24 GMT]]></title><description><![CDATA[<p>Versuch mal das hier:</p>
<p>Image1 und ScrollBox1 sollten klar sein. BitmapShow ist das Bild, das in dem Image dargestellt werden soll (TBitmap). Sollte sich auch ohne Probleme auf TJPEGImage anpassen lassen.</p>
<pre><code class="language-cpp">TRect ar;
	double factor_x;
	double factor_y;
	double factor;

	factor_x = (double) BitmapShow-&gt;Width / (double) ScrollBox1-&gt;ClientWidth;
	factor_y = (double) BitmapShow-&gt;Height / (double) ScrollBox1-&gt;ClientHeight;
	factor = factor_x &gt; factor_y ? factor_x : factor_y;

	ar.top = 0;
	ar.left = 0;
	ar.right = BitmapShow-&gt;Width / factor;
	ar.bottom = BitmapShow-&gt;Height / factor;

	// Darstellung des Bitmaps
	Image1-&gt;Picture-&gt;Assign(NULL);
	Image1-&gt;Top = 0;
	Image1-&gt;Left = 0;
	Image1-&gt;Width = ar.right;
	Image1-&gt;Height = ar.bottom;
	Image1-&gt;Proportional = false;

	Image1-&gt;Canvas-&gt;StretchDraw(ar, BitmapShow);

	if (Image1-&gt;Height &lt; ScrollBox1-&gt;ClientHeight) // vertikal zentrieren?
		Image1-&gt;Top = (ScrollBox1-&gt;ClientHeight - Image1-&gt;Height) / 2;
	else
		Image1-&gt;Top = 0;
	if (Image1-&gt;Width &lt; ScrollBox1-&gt;ClientWidth)	// hozizontal zentrieren?
		Image1-&gt;Left = (ScrollBox1-&gt;ClientWidth - Image1-&gt;Width) / 2;
	else
		Image1-&gt;Left = 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1136589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136589</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 13 Sep 2006 12:25:24 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 12:25:25 GMT]]></title><description><![CDATA[<p>Proportional ist eine Eigenschaft von TImage im BCB6.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136590</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136590</guid><dc:creator><![CDATA[Morris Szyslak]]></dc:creator><pubDate>Wed, 13 Sep 2006 12:25:25 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 12:30:15 GMT]]></title><description><![CDATA[<p>Ob diese Eigenschaft soviel nützt? Damit kann man z.Bsp. ein Bild nicht vergrößern. Joes Methode scheint mir da geeigneter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136599</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 13 Sep 2006 12:30:15 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Wed, 13 Sep 2006 12:40:29 GMT]]></title><description><![CDATA[<p>hm...</p>
<p>Image-&gt;Proportional=true;<br />
Image-&gt;Stretch=true;<br />
Image-&gt;Align=alClient;</p>
<p>Vergrößert und verkleinert bei mir ganz gut. Wenn ich Joe_M.s Code richtig verstehe, tut er so ziemlich das gleiche.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136604</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136604</guid><dc:creator><![CDATA[Morris Szyslak]]></dc:creator><pubDate>Wed, 13 Sep 2006 12:40:29 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Thu, 14 Sep 2006 08:08:09 GMT]]></title><description><![CDATA[<p>Ja ist es. So wie ich es verstanden hab, geht es hier um den BCB 5, da gab es wohl die Proportional-Eigenschaft noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1137048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137048</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 14 Sep 2006 08:08:09 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Thu, 14 Sep 2006 08:19:09 GMT]]></title><description><![CDATA[<p>Du verwendest Proportional doch auch. <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="🙂"
    /><br />
Das kannst du natürlich auch weglassen.<br />
Meine Aussage bezog sich auf folgenden Text aus der BCB6-Hilfe</p>
<blockquote>
<p>Setzen Sie Proportional auf true, damit die Grafik vollständig im TImage-Steuerelement angezeigt wird und keine Verzerrungen wie bei der Eigenschaft Stretch vorkommen. Grafiken, die zu groß für das Steuerelement sind, werden solange skaliert (wobei das Bildseitenverhältnis beibehalten wird), bis sie in dem Steuerelement vollständig angezeigt werden können. Zu kleine Grafiken werden in der normalen Größe dargestellt. Proportional kann Grafiken verkelinern, aber nicht vergrößern.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1137057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137057</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 14 Sep 2006 08:19:09 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Thu, 14 Sep 2006 08:35:17 GMT]]></title><description><![CDATA[<p>Ups, ja richtig... Hätte ich rauslöschen sollen. Das Codeschnipsel stammt aus einer Routine, mit der man die Bilder, unter anderem, auch ein- und auszoomen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1137071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137071</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 14 Sep 2006 08:35:17 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 06:46:29 GMT]]></title><description><![CDATA[<p>Danke für eure Antworten. War seit Mi im verlängerten WE-Urlaub und kann deshalb erst jetzt antworten. Also das Code-Beispiel von Joe_M. find ich richtig gut. Hab da aber leider noch ein kleines Problem:</p>
<p>BitmapShow-&gt;Width erkennt mein Complier net. Aber wenn mich nicht alles täuscht sind das die Daten des Bilds selber. Deshlab habe ich das einfach durch: Image-&gt;Picture-&gt;Graphic-&gt;Height ersetzt.<br />
Dadurch hab ich dann auch keine Fehler mehr.<br />
Problem ist dann nur, dass ich ein weißes Bild habe. die Größe passt er mir aber immer an und in der StatusZeile bekomme ich auch den Dateinamen angezeigt. Ich habs auch schonmal mit Image-&gt;Refresh() versucht, hat aber leider auch nicht geholfen.</p>
<p>Hier mal mein Code:</p>
<pre><code class="language-cpp">void TMainProg::Bild_laden(AnsiString bild)
{
  Image-&gt;Picture-&gt;LoadFromFile(bild);
  StatusBar-&gt;Panels-&gt;Items[0]-&gt;Text=&quot;Aktuell angezeigtes Bild: &quot; + bild.SubString(bild.LastDelimiter(&quot;\\&quot;)+1,bild.Length());
  //Bild anpassen
  TRect ar;
    double factor_x;
    double factor_y;
    double factor;

    factor_x = (double) Image-&gt;Picture-&gt;Graphic-&gt;Width / (double) ScrollBox1-&gt;ClientWidth;
    factor_y = (double) Image-&gt;Picture-&gt;Graphic-&gt;Height / (double) ScrollBox1-&gt;ClientHeight;
    factor = factor_x &gt; factor_y ? factor_x : factor_y;

    ar.top = 0;
    ar.left = 0;
    ar.right = Image-&gt;Picture-&gt;Graphic-&gt;Width / factor;
    ar.bottom = Image-&gt;Picture-&gt;Graphic-&gt;Height / factor;

    // Darstellung des Bitmaps
    Image-&gt;Picture-&gt;Assign(NULL);
    Image-&gt;Top = 0;
    Image-&gt;Left = 0;
    Image-&gt;Width = ar.right;
    Image-&gt;Height = ar.bottom;

    Image-&gt;Canvas-&gt;StretchDraw(ar, Image-&gt;Picture-&gt;Graphic);

    if (Image-&gt;Height &lt; ScrollBox1-&gt;ClientHeight) // vertikal zentrieren?
        Image-&gt;Top = (ScrollBox1-&gt;ClientHeight - Image-&gt;Height) / 2;
    else
        Image-&gt;Top = 0;
    if (Image-&gt;Width &lt; ScrollBox1-&gt;ClientWidth)    // hozizontal zentrieren?
        Image-&gt;Left = (ScrollBox1-&gt;ClientWidth - Image-&gt;Width) / 2;
    else
        Image-&gt;Left = 0;
   Image-&gt;Refresh();
}
</code></pre>
<p>Hoffe ihr könnt mir nochmal helfen.</p>
<p>Kiki</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139325</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Mon, 18 Sep 2006 06:46:29 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 07:31:35 GMT]]></title><description><![CDATA[<p>Das liegt an der Image-&gt;Picture-&gt;Assign(NULL). Dort wird das 'alte' Bild gelöscht, bevor das neue eingefügt wird. Laß die Zeile einfach mal raus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139351</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 18 Sep 2006 07:31:35 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 07:48:28 GMT]]></title><description><![CDATA[<p>Danke für den Tipp, funktioniert aber leider nicht. Wenn ich die Zeile ausblende bekomme ich folgenden Fehler:...im Projekt ist folgende Exception der Klasse EInvalidOperation aufgetreten. &quot;Ein Bild kann nur geändert werden, wenn es ein Bitmap enthält!&quot;...</p>
<p>Heißt das etwa, dass dieser Code nur für *.bmp funktioniert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139362</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Mon, 18 Sep 2006 07:48:28 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 07:54:44 GMT]]></title><description><![CDATA[<p>Nein nicht unbedingt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Kannst auch JPEGs oder GIFs nehmen, allerdings habe ich es bei mir so gelöst, dass die Bilder, nach dem Einlesen einem TBitmap zugewiesen werden. Sprich das Bild in ein TJPEGImage einlesen, dieses dann einem TBitmap 'assignen'.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139367</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 18 Sep 2006 07:54:44 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 08:08:56 GMT]]></title><description><![CDATA[<p>Aha, ich glaube fast, dass das für mich noch zu hoch ist. Werde mich gleich mal schlau machen, wie ich das machen kann.<br />
Kannst mir vielleicht auch ein Code-Bsp geben. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>THX</p>
<p>EDIT:<br />
Geht das ungefähr so: (hab ich in der BSB Hilfe gefunden)</p>
<p>TJPEGImage *jp=new TJPEGImage();<br />
try<br />
{<br />
jp-&gt;Assign(Image-&gt;Picture-&gt;Bitmap);<br />
}<br />
__finally<br />
{<br />
delete jp;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139374</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Mon, 18 Sep 2006 08:08:56 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 08:16:03 GMT]]></title><description><![CDATA[<p>Das hängt mehr davon ab, in welchem Format die Bilder auf der Festplatte gespeichert sind. Für diese Formate gibt es Importfilter (eben zum Beispiel TJPEGImage). Damit liest man die Datei ein. Zur Verarbeitung verwendet man Bitmaps, weil dies das native Fornmat unter Windows ist.</p>
<p>In welchem Format liegen die Bilder bei Dir vor?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139382</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 18 Sep 2006 08:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to TImage anpassen on Mon, 18 Sep 2006 08:47:05 GMT]]></title><description><![CDATA[<p>Sind in der Regel *.jpg bzw. *.jpeg</p>
<p>Edit:<br />
Mein Code sieht jetzt so aus. Scheint auch zu funktionieren, tut es aber leider nicht 100%ig. Ich habe ein Bild mit Paint erstellt und als *.jpg gespeichert. In diesem Bild habe ich auch Text eingefügt. Wenn ich dieses Bild lade, gibt es einige Fehler. Die Schrift ist glaub ein bissle verzert und nicht vollständig. Wenn ich das Bild lade die größe manuell (habe im Explorer die Größe und Breite nachgeschaut und im Image-&gt;Widht bzw. -&gt;Height manuell eingegeben)anpasse, dann wird das Bild richtig angezeigt.</p>
<pre><code class="language-cpp">void TMainProg::Bild_laden(AnsiString bild)
{
  Image-&gt;Picture-&gt;LoadFromFile(bild);
  StatusBar-&gt;Panels-&gt;Items[0]-&gt;Text=&quot;Aktuell angezeigtes Bild: &quot; + bild.SubString(bild.LastDelimiter(&quot;\\&quot;)+1,bild.Length());
  Graphics::TBitmap *bmp = new Graphics::TBitmap();
  try
  {
    bmp-&gt;Assign(Image-&gt;Picture-&gt;Graphic);
  }
  catch(...)
  {

  }
  //Bild anpassen
  TRect ar;
    double factor_x;
    double factor_y;
    double factor;

    factor_x = (double) bmp-&gt;Width / (double) ScrollBox1-&gt;ClientWidth;
    factor_y = (double) bmp-&gt;Height / (double) ScrollBox1-&gt;ClientHeight;
    factor = factor_x &gt; factor_y ? factor_x : factor_y;

    ar.top = 0;
    ar.left = 0;
    ar.right = bmp-&gt;Width / factor;
    ar.bottom = bmp-&gt;Height / factor;
    // Darstellung des Bitmaps
    Image-&gt;Picture-&gt;Assign(NULL);
    Image-&gt;Top = 0;
    Image-&gt;Left = 0;
    Image-&gt;Width = ar.right;
    Image-&gt;Height = ar.bottom;

    Image-&gt;Canvas-&gt;StretchDraw(ar, bmp);

    if (Image-&gt;Height &lt; ScrollBox1-&gt;ClientHeight) // vertikal zentrieren?
        Image-&gt;Top = (ScrollBox1-&gt;ClientHeight - Image-&gt;Height) / 2;
    else
        Image-&gt;Top = 0;
    if (Image-&gt;Width &lt; ScrollBox1-&gt;ClientWidth)    // hozizontal zentrieren?
        Image-&gt;Left = (ScrollBox1-&gt;ClientWidth - Image-&gt;Width) / 2;
    else
        Image-&gt;Left = 0;
    delete bmp;
}
</code></pre>
<p>Edit2:<br />
Es handelt sich echt nur um minimale Fehler in der Darstellung des Textes.<br />
Kann dieser Fehler eventuell durch dich Division kommen. Hierbei entsteht ja eine Kommzahl. Und am Ende wird ja aus der Kommazahl (z.B. 736,6) wieder ein Integer erstehlt. Ich hab jetzt grad überlegt, ob eventuell bei Image-&gt;Width aufgerundet und bei Image-&gt;Heigth abgerundet wird, und dass dieser eine Pixel dann das Bild so leicht verzerrt, dass es auffällt.<br />
Was haltet ihr davon??? Holzweg <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /> oder gute Idee <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="👍"
    /> ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139384</guid><dc:creator><![CDATA[kiki_666]]></dc:creator><pubDate>Mon, 18 Sep 2006 08:47:05 GMT</pubDate></item></channel></rss>