From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add a picture in labview front panel

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 7
(30,053 Views)

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).

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(30,038 Views)

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

0 Kudos
Message 3 of 7
(30,025 Views)
Solution
Accepted by wfarid

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.

Message 4 of 7
(30,011 Views)

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?

0 Kudos
Message 5 of 7
(13,020 Views)

(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.

0 Kudos
Message 6 of 7
(13,006 Views)

Thank you so much for the ideas and concerns.  I'll defiinitely keep those in mind. Best Grades, Hassan.

0 Kudos
Message 7 of 7
(12,996 Views)