574 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...