842 views
in GUI Development by
Each Views::Image has a property "Color". However if I change his value, nothing happens. Is it possible in Embedded Wizard to change the color of a resource image?

1 Answer

0 votes
by

The usage of the Color property within the Views::Image class depends on the type of bitmap you are using:

If you are using a bitmap resource that contains color information, then the opacity of the bitmap is modulated by the alpha value of the Color property. However, if you are using a bitmap resource that contains only alpha information, then you can use the Color property to colorize the image dynamically during runtime. This is a powerful feature!

The following example will illustrate this: This is an image stripe, that contains a set of icons that are painted white on a black background.

This image file is now used as a bitmap resource - however, it is not assigned to the attribute 'FileName' - it is assigned to the attribute 'AlphaName'.

In this case, the image is interpreted as alpha image: Black means fully transparent, white means fully opaque and all gray values are in-between.

If you are now displaying Views::Image objects that are using this bitmap resource, you can dynamically colorize your icons:

Additional remark: The bitmap resource contains a set of icons - therefore, the attribute FrameSize of the bitmap resource is set to the size of each icon (here <64,64>). The single icons can be selected within the Views::Image object by setting its FrameNumber property.

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...