474 views
in GUI Development by

Hi

Could you please tell me:

1. How to modify the HorizontalValueBar filled color?

2.How to modify the HorizontalValueBar background color from white to grey?

I also add HorizontalValueBarConfig, but it looks like no work.

I want to a HorizontalValueBar like this.

This is what I made.

 

Regards,

Sancia

1 Answer

0 votes
by
 
Best answer

Hello Sancia,

the default Value Bar configuration uses bitmap resources containing the green colors. To configure the Value Bar with other colors (or other visual aspects), you will need to create your own bitmap resources.

To achieve this you create an image file (e.g. PNG) by using a graphic editor like Affinity Designer, GIMP, Photoshop, etc. and then you add the image file to your Embedded Wizard project as a new bitmap resource. This bitmap resource can then be assigned to a Value Bar configuration object. In other words to have grey value bar, you would need to create some image with the value bar shape and the desired grey color.

See also the chapters Specify the bitmap and color for the Value Bar's left track image and Specify the bitmap and color for the Value Bar's right track image for more details how the image file has to be designed. Especially note the 9-slice image scaling aspect.

If your Value Bar is monochrome, you can configure the bitmap resource in the ALPHA8 format. This means the bitmap will provide opacity information only. The desired color is determined by the TintXXX properties in the Value Bar config object.

From your screenshot there are two white icons visible. To display them you would need to create a further bitmap resource and assign it to the Value Bar config object as so-called Cover. See also Specify the bitmap and color for the Value Bar's cover image. Please note also the description from the chapter Customize your own Horizontal Value Bar explaining from which parts the Value Bar is composed internally.

I hope it helps you further.

Best regards

Paul Banach

by
Thank you very much for your good idea.

But now I have a new question.

How to touch and slide the HorizontalValueBar to set a value like brightness.

I hope it has the similar function like Horizontal Slider to set an integer value by simple touching and dragging.

Kindly suggest some ideas。

Regards,

Sancia
by

Hello Sancia,

Value Bar is not interactive - it can't respond to touch events. Instead of it use the Horizontal Slider. It has a functionality similar to the of Value Bar and it can react to user interactions.

The Slider can be configured in the same manner as you configure the Value Bar. Just provide the bitmaps you have created (as explained above) to a Horizontal Slider Config object instead of to a Value Bar Config object. See also the section Customize your own Horizontal Slider.

Best regards

Paul

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

...