LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save image from picturebox

I have an image in a PictureBox (.NET).

Is possible to save the image showed in the PictureBox in an archive (.jpg, .bmp or others formats).

 

Thanks!

0 Kudos
Message 1 of 34
(9,770 Views)
Take a look at the Graphics and Sound>>Graphics Format  pallete.  There are vi's there that will take an image and write a JPG, BMP or PNG.
Message 2 of 34
(9,757 Views)

The code will look something like this:

 

 

0 Kudos
Message 3 of 34
(9,755 Views)

jmcbee,

the main problem ís:  "How to trasform pictureBox data into picture format?"

If I do this transformation, I will be able to use the VIs that you showed.

Thank you for help.

0 Kudos
Message 4 of 34
(9,718 Views)

The .NET PictureBox isn't the same as the picture control. jmcbee has them confused. Smiley Wink In order to save a the image in a .NET PictureBox you need to get the image (via the Image property) and then call the Image class Save method. This is documented on MSDN.

 

http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.image.aspx

http://msdn.microsoft.com/en-us/library/system.drawing.image.save.aspx

 

Message Edited by smercurio_fc on 03-15-2009 09:36 AM
0 Kudos
Message 5 of 34
(9,709 Views)


smercurio_fc,
I tried to save the image from .NET PicturBox via Image Property and calling the Image Class Save (String: Filename) but I hadn't success.
I'm not passing the path in the wright way. The VI always return the error NULL ObjectId.

Could Anybody help me!?

Thank you for help!

 Front Panel Error

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Block Diagram

0 Kudos
Message 6 of 34
(9,696 Views)
That indicates that the Image object was null, hence the Save method couldn't work. How is the image being loaded into the PictureBox? Can you post your VI?
0 Kudos
Message 7 of 34
(9,679 Views)

The complement of the Block Diagram is right down.

Thanks for help!

 

Block Diagram  - Part2

0 Kudos
Message 8 of 34
(9,672 Views)
It would be a lot easier if you just posted your VI. I have no idea what that avicap32.dll is. Whatever it is, it's probably not setting the Image property so that you can use it later. What version of LabVIEW are you using? If you're using something more that 8.2 than you should be using the error clusters on those Call Library Function Nodes to provide your data dependency for execution flow, rather that a sequence frame.
0 Kudos
Message 9 of 34
(9,636 Views)

Hi fernandob...,

there is also a command (SendMessage cmd) to send the image to the clipboard, you can then read it from there and store it to a file.

See this link http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ff7893d5-0060-4456-ad25-8a331d8b4...

 

Mike

Message Edited by MikeS81 on 03-16-2009 03:08 PM
0 Kudos
Message 10 of 34
(9,630 Views)