Refresh Bitmap Firemonkey

  

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:

Second:

After moving out of screen :

Comments are closed.