Show: Delphi C++
Display Preferences

FMX.Objects.TImage.Bitmap

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Bitmap: TBitmap read GetBitmap write SetBitmap;

C++

__property Fmx::Graphics::TBitmap* Bitmap = {read=GetBitmap, write=SetBitmap};

Properties

Type Visibility Source Unit Parent
property public
FMX.Objects.pas
FMX.Objects.hpp
FMX.Objects TImage

Description

Specifies the bitmap picture that will be displayed by this TImage component.

Set the Bitmap property to the bitmap picture that you want to be displayed by this TImage component. Reading Bitmap provides a TBitmap image that you can assign to other TImage components or you can save to a stream or a file.

The Bitmap getter retrieves the Bitmap image from the appropriate bitmap item of the multi-resolution bitmap stored in MultiResBitmap. When you set a new value to the bitmap, the Bitmap setter saves this bitmap in this bitmap item of the MultiResBitmap multi-resolution bitmap. If you change this bitmap item in MultiResBitmap by any way, this will change the Bitmap image. For example, you can edit MultiResBitmap in the MultiResBitmap Editor from the Object Inspector.

For a list of image formats supported by this component, please refer to the TBitmapCodecManager API help topic.

You can also assign an image programmatically, as exemplified in the following code snippet:

  Image1.Bitmap.LoadFromFile('MyImage.jpg');
Note: The Bitmap getter uses the following algorithm to retrieve the Bitmap property's value:
  1. Using the GetSceneScale function for the Scene in which the control is drawn, the Bitmap getter retrieves the Scale for the current device. If Scene is not defined, then the 1.0 value for Scale is accepted.
  2. If MultiResBitmap is assigned, then the getter gets the Bitmap from the bitmap item having the scale best matching to the obtained Scale (not including empty bitmap items.)
  3. If the getter does not find any not empty bitmap item, then the getter tries to retrieve an empty bitmap item having the scale exactly matching to the obtained Scale.
  4. If the getter cannot find an empty bitmap item having the obtained Scale, then the getter creates a new bitmap item with the obtained Scale and returns the bitmap from the created bitmap item.
  5. If the obtained Scale <= 0 or MultiResBitmap is not assigned, the exception is raised.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance