2
votes

I am trying to build an application with Delphi 10 Berlin for smart devices. In this app, i want to load or take a photo and than i have to position another component with the same X position an width of the image. My problem is, when i assign an image to TImage control the bitmap do not take all area of TImage control, the image is smaller. How do i get the real X position and width of the bitmap in TImage control? Here is my code:

begin
   if Image1.Bitmap.Height > Image1.Bitmap.Width then
   begin
     Image1.Bitmap.Rotate(-90);
   end;
   Image1.Bitmap.Assign(Image);
   Memo1.Width := Image1.Width;
   Memo1.Text := '';
end;
1
I tried all WrapMode values, but, after assigned the photo to TImage control, the image became smaller than the image control, i tried stretch, but the image become distorted. I need to setup the WrapMode property to 'FIT', and change the width of others controls with the width of image that appears at screen to keep them aligned. Is there some code to get image width after it has been loaded to bitmap property of timage control? - RicardoPin

1 Answers

2
votes

The FireMonkey TImage component has a property called WrapMode which helps you in controlling how the image bitmap is rendered on the TImageSurface.

You can read more about it in official documentation here:

http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.Objects.TImage.WrapMode

NOTE: This property and its connected functionality is only available for the FireMonkey version of TImage, not for the VCL version.