简体   繁体   中英

How to assign a graphic to an FMX TImage in the IDE?

In the Delphi IDE, how do you assign a graphic to a TImage?

In VCL, in the Object Inspector, you use the "Picture" property of the TImage. But in FMX, I don't see "Picture" in the Object Inspector, or anything else like it ("Bitmap", "Graphic", etc.)

Please have mercy. I have 20+ years experience in Delphi VCL, but I'm a raw newbie in FireMonkey!

The property you're looking for is MultiResBitmap . It's use is covered in the documentation under Using Multi-Resolution Bitmaps . The portion pertaining to TImage :

In TImage controls. TImage controls keep a TFixedMultiResBitmap multi-resolution bitmap in the MultiResBitmap property. TFixedMultiResBitmap is the descendant of TCustomMultiResBitmap . A TFixedMultiResBitmap multi-resolution bitmap can contain any number of bitmap items having different scales. On each device, TImage retrieves the most appropriate bitmap to display from the bitmap collection in the TFixedMultiResBitmap multi-resolution bitmap and refers to the obtained bitmap with the Bitmap property. The obtained bitmap depends on the device resolution and scales of bitmap items kept in the TFixedMultiResBitmap multi-resolution bitmap. If a multi-resolution bitmap does not contain a bitmap item having exactly the scale required by some particular screen, then FireMonkey automatically stretches or zooms out the bitmap item having the most appropriate scale. For information about how this bitmap is obtained, see Bitmap . Keep in mind that each bitmap item takes resources of the application's executable on all platforms (even if some bitmap item is never used on a particular platform).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM