LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

view images in front panel

hello,
 
I want to see some photos and video in front panel, but not by Import Image, I want to select a folder and it show automatically the photos and video.
 
Thanks!

Mensaje editado por Juank

Mensaje editado por Juank

0 Kudos
Message 1 of 3
(2,831 Views)

Lots of programming to do this.  I can start you off.  On front panel, create a path control, picture control, and stop button.  Right click and set browse options to existing dir.  On block diagram, create a while loop.  Inside the while loop, create an event structure.  Create two events, one for the stop button value change, and another for the path control value change.  Now you have a structure to take action when a user selects a folder or clicks the stop button.

Lets try displaying one picture for now.  Inside the path control event, you must get a list of files in the folder.  Use the List Directory function found in File I/O - Advanced File Functions.  This produces a list of the files in the folder.  If you wire a string constant into the pattern input, like *.jpg, it will only list those files.  The output is an array of file names.  Build a path to the file by using the Build Path function (File I/O palette), path control supplies the base path, index one of the file list array elements to get a file name.  Look in Graphics & Sound - Graphics Format, and choose the Read JPEG File vi.  Wire the file path into this vi.  The output is Image Data.  Look in Graphics & Sounds - Picture Functions.  Choose Draw Flattened Pixmap.vi.  Wire the Image Data as input, and wire the output to the picture control from the front panel.  Don't forget to wire the stop button in the stop button value change event case to the while loop stop sign.  Run the vi and select a folder with the path control.  If there is a jpg file in there, it will display the picture inside the picture control box (resize to desired size).

To continue, you must create another loop that will perform the picture display actions for each file listed.  You will probably want to put a delay between each picture viewing or a next button or something.  Start with what I've given you and we can go from there.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(2,806 Views)
You could also embed a video/photo activeX control on the front panel.  This was you can have a flexible viewer with minimal coding
 
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 3
(2,797 Views)