56 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

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

...