1.2k views
in GUI Development by
Hi Everyone,

        I am trying to create traffic signal window.

i have added 4 bitmap frame when i change color one frame it will reflect corresponding frame (red,green or yellow) .how to do please guide me to complete this.

1 Answer

0 votes
by

Hello GuruRamesh,

possibly you are mixing two concepts: (1) selecting a frame from a multi-frame bitmap and (2) coloring an alpha-only bitmap.

So far I understood your application case, you can either create a multi-frame bitmap containing different images for the different light colors

or

You create a simple (single-frame) bitmap containing a single generic image of the traffic light in the alpha-only format. Then you can colorize the image at the runtime.

I hope it helps you further.

Best regards

Paul Banach

by
Hi Paul Banach,

     Thanks for the update.i am using multiframe class ,but i am not able to view image when i apply bit map.can you pleae breifly explain how to use and how to apply bitmap.

   i need 4 colors ,how to change the frame nos  .please expalin briefly .it is useful for me.
by

Hello GuruRamesh,

please see the following documentation:

Project members: Bitmap resource

Using Views: Image

Best regards

Paul Banach

by
Hi Paul Banach,

    I followed the documents and i added bitmap resource .

     Using image i have display the resource.when i build i am able to see the all images.

   here i am using image class to display the image then what is the use of  Frames here.

  how to change color based on input color .please share it.
by

Hello GuruRamesh,

I'm sorry, but I don't understand what you mean with 'how to change color based on input color .please share it.'.

Concerning the usage of frames please see the section: Select the frame number of a multi-frame bitmap resource.

Best regards

Paul Banach

by
Thanks for the update.

     i have created one componet and i have enum for 3 signal color (red,yellow,green)

 trafsignal.signal_status=Application::signal_status.greenSignal;  //now green siganl is enabled   and it is show in last position.

trafsignal.signal_status=Application::signal_status.yellowsignall; //now yellow signal is enabled   and it is show in middle position

trafsignal.signal_status=Application::signal_status.redsignall; //now red signal is enabled   and it is show in first position

(redcolor  yellowcolor green color --my light order like this)

 

here green working fine but when i run yellowsignal-how to change object to middle position.
by
Hello GuruRamesh,

if the above code lines have the desired effect to change the signal color to green/yellow/red, then you will need to execute the right code line when your application runs in the corresponding signal state. Where you implement the code or how you trigger it, its depending on your application case.

Best regards

Paul Banach
by
got it Paul Banach.

Thanks

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

...