RicardoPin
RicardoPin

Reputation: 21

Delphi 10 TImage, image width for mobile

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;

Upvotes: 2

Views: 1471

Answers (1)

SilverWarior
SilverWarior

Reputation: 8396

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.

Upvotes: 2

Related Questions