LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write mulitple .png images

Solved!
Go to solution

Is is possible to write multiple .png images to a folder designated by a path?

I'm surprised I really haven't found any documentation about this.

 

What I am able to do is:

-capture a single .png image from a camera and save it to a folder

-run the camera in a video mode and view the video through a VI

 

I would basically like to run it in a video mode and capture each frame and save it as a .png file.

I'm not too familiar with LabVIEW, so please forgive my ignorance.

0 Kudos
Message 1 of 4
(3,206 Views)
Solution
Accepted by topic author jmeyer33

Hi jmeyer33,

 

You can designate a base path for your folder and then give each file a different relative path by using the Build Path VI. You can concatenate the filename and the Loop Iteration value from the while loop (converted to a string with Number to Decimal String) if you want each name to be the same except for a counter at the end (picture0.png, picture1.png, picture2.png, etc.).

 

Regards,

Stephen S.

National Instruments
Applications Engineering
Message 2 of 4
(3,172 Views)

 

 

Stephen (or others),

I am using the Build Path VI and the Number to Decimal String.  However, the iteration is added to the very end of the base path.  For example, "C:\Program Files\png_.png" becomes "C:\Program Files\png_.png\1" in the iteration.  Is there a way to add  the iteration in the middle of the path, such as "...\png_1.png", "...\png_2.png"?

 

Also, I have the appended path as input into an IMAQ Write File 2 VI.  It doesn't seem to be writing the iterations though, perhaps because they have no extension (because they are ending up looking like "...\png_.png\1", "...\png_.png\2", and so on)?  I don't know.  Any suggestions would be greatly appreciated.

0 Kudos
Message 3 of 4
(3,146 Views)
User "Format into String" and png_%d.png as format string. Use the output string as input to the Build Path function.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 4 of 4
(3,136 Views)