简体   繁体   English

如何在IDE中为FMX TImage分配图形?

[英]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? 在Delphi IDE中,如何将图形分配给TImage?

In VCL, in the Object Inspector, you use the "Picture" property of the TImage. 在VCL中,在对象检查器中,使用TImage的“图片”属性。 But in FMX, I don't see "Picture" in the Object Inspector, or anything else like it ("Bitmap", "Graphic", etc.) 但是在FMX中,我没有在对象检查器中看到“图片”或类似的东西(“位图”,“图形”等)。

Please have mercy. 请怜悯。 I have 20+ years experience in Delphi VCL, but I'm a raw newbie in FireMonkey! 我在Delphi VCL中有20多年的经验,但是我是FireMonkey的新手!

The property you're looking for is MultiResBitmap . 您要查找的属性是MultiResBitmap It's use is covered in the documentation under Using Multi-Resolution Bitmaps . 文档的使用多重分辨率位图下涵盖了它的用法。 The portion pertaining to TImage : TImage有关的部分:

In TImage controls. 在TImage控件中。 TImage controls keep a TFixedMultiResBitmap multi-resolution bitmap in the MultiResBitmap property. TImage控件在MultiResBitmap属性中保留TFixedMultiResBitmap多分辨率位图。 TFixedMultiResBitmap is the descendant of TCustomMultiResBitmap . TFixedMultiResBitmapTCustomMultiResBitmap的后裔。 A TFixedMultiResBitmap multi-resolution bitmap can contain any number of bitmap items having different scales. TFixedMultiResBitmap多分辨率位图可以包含任意数量的具有不同比例的位图项。 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. 在每个设备上, TImageTFixedMultiResBitmap多分辨率位图中的位图集合中检索最适合显示的位图,并使用Bitmap属性引用获得的位图。 The obtained bitmap depends on the device resolution and scales of bitmap items kept in the TFixedMultiResBitmap multi-resolution bitmap. 所获得的位图取决于设备分辨率和TFixedMultiResBitmap多分辨率位图中保存的位图项的比例 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. 如果多分辨率位图不包含具有某些特定屏幕所需缩放比例的位图项,则FireMonkey会自动拉伸或缩小具有最合适比例的位图项。 For information about how this bitmap is obtained, see Bitmap . 有关如何获取此位图的信息,请参见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). 请记住,每个位图项都在所有平台上占用应用程序可执行文件的资源(即使某些位图项从未在特定平台上使用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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