简体   繁体   中英

How to change the color of TCylinder in Delphi Firemonkey

I can create a Cylinder

Img: TControl3D;
Img := TCylinder.Create(nil);

however Img does not seem to have a colour property. Even when I cast it as a cylinder. It seems to be defaulting to red. Also the object inspector does not have a colour property for cylinders either.

Each 3D shape object has MaterialSource property - use it to give your shape color/texture.

If you want to set shape material to solid colour, use TColorMaterialSource component, set color that you want, and link it to the shape's MaterialSource property.

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