0
votes

I use Delphi 10.2 Tokyo, and I have a TForm with a TImage.

I load a PNG file to MultiResBitmap property and set WrapMode to Fit.

When I run my application and click on a button, I need to change this picture and load a JPG file.

I use Image.Bitmap.LoadFromFile if the file is on the harddrive or Image.Bitmap.LoadFromStream if the JPG file is from a WebService (Get from IdHTTP). Both are on a Try...Finally with Image.BeginUpdate and Image.EndUpdate;

That's ok I see my new picture but the bottom isn't really good, I see a part of the previous picture. I need to move the TForm outside of my screen to see it full.

I try Image.Repaint at the end or to Clear the Bitmap before load the new file with Image.Bitmap.Clear(TAlphaColors.White) but that's change nothing.

Somebody know why ?

Edit: I forgot to say that TransparentColor is set on White.

  • First:

enter image description here

  • Second:

enter image description here

  • After moving out of screen :

enter image description here

2
Can you explain more please, where exactly you stuck in, and show the code please.Ilyes

2 Answers

0
votes

Just do it as:

Image1.MultiResBitmap[0].Bitmap.LoadFromFile('Location\Image.jpg');
0
votes

Try without BeginUpdate and EndUpdate.