06-13-2010 04:21 PM
Hello,
I need some help in adding a picture to the labview front panel and then coloring specific pixels in this picture. For example, adding a road picture and then coloring the road pixels in the picture with different colors depending on some other input.
Can it be done in Labview ?
Thank you,
Walid
Solved! Go to Solution.
06-13-2010 08:11 PM
This can be done in labview (almost anything can)
Do you have an example of what you need done?
2 main methods: draw completly in picture control (code intensive) or import picture to fp and overlay color controls on top (less flexable and requires some creativity).
06-13-2010 08:46 PM
Thanks Paul.
I'd rather go with the picture occupying a portion of the FP than all the FP, so I guess that is what you meant by using "picture control ", right ?
The example would be like this : I've a picture with a road, and I want to color the pixels of the road with specific colors depending on another input that I have.
So, is there any code snippet that can get me started.
Thank you,
Walid
06-13-2010 10:46 PM
wfarid wrote:
So, is there any code snippet that can get me started.
Yes. They ship with LabVIEW, and are called examples. Help -> Find Examples. Then search for "picture". If you have the picture saved as a file then simply read it using one of the graphics VIs and feed the data to the Draw Flattened Pixmap. Then send that to a picture control.
05-08-2015 01:13 PM
Hi, I have made a program for the 10 countries in the world that start with the letter P. My inputs are the abbreviation of a country among the list and the local time in NJ. For the outputs, the user gets the complete name of country, the location, 3 facts about that country, local time in that country, the sun rise and sunset timing, if the local time is during the daylight time the boolean will glow up, and finally, a picture of the flag of country. However, the problem I'm facing is that I have to upload the picture of everycountry every single time I run the program. Is there any way i can just upload the photos and won't have to upload them over and over again everytime i open the program.
Moreover, I've just listed those countries' abbreviations by typing them. Is there anyway I can make each abbreviation an icon and upon clicking, the user will get all the outputs?
05-08-2015 01:29 PM - edited 05-08-2015 01:34 PM
(You should not add to a 5 year old thread that is already marked as solved. Next time please start a new dicussion. Thanks!)
You can customize boolean buttons with an image.
Overall, you have a huge amount of duplicate code. The cases differ only by a few diagram constants. You could probably eliminate the case structure by indexing into an array of a clusters containing all information (including the flag pixmap) for one country per element and pipe it through one single instance of the code to the indicators. Ideally, the code should read all information from a datafile when it starts so countries can be added or removed later without code change.
Your code does not seem to have a while loop. Are you using "continuous run" mode? Don't! That is just a debugging feature and is not meant for normal use.
05-08-2015 01:37 PM
Thank you so much for the ideas and concerns. I'll defiinitely keep those in mind. Best Grades, Hassan.