07-08-2009 05:19 PM
Thanks for the reply and the code. Your vi worked fine on my system. I guess it must have something to do with the SDK I'm using to get the image and populate the picturebox. Maybe I am corrupting the picturebox image somehow.
I switched my vi to use the same methods as yours and I still got the exception. When I modified your to save as a jpeg using the same method I am using it worked fine.
It seems like the image I am getting from the SDK that says it is a Bitmap class is able to be displayed in the picturebox but is not able to be saved to a file. If I load your boxes.bmp into the same vi and use the exact same code I can save it no problem. I guess I'll try playing with the Bitmap object and seeing if I can mold it into something that works.
08-06-2009 09:49 AM
smercurio_fc,
I'm not familiar with .NET in the least but need the functionality of a webcam snapshot for a test system. My company does not have the vision module, so I am very interested in this approach. However, all I get from what we have hacked together and your vi is the 1172 null key error, every time. I do see that the image is being copied to the clipboard though as I am able to paste it into MS word.
Jim
08-06-2009 10:23 AM
08-06-2009 10:26 AM
I was referring to the one you posted, webcam_fernando_saveas.vi. We have tried others that are basically the same as yours but always get stuck at the bitmap save node.
08-07-2009 01:23 PM
I'm not sure, but I think the problem may be due to a wiring error in my original example. As I had noted in that reply, I don't have a webcam, so there was no way for me to test the VI. I've attached an updated VI but I have no idea if it will work.
08-07-2009 02:22 PM
08-07-2009 03:01 PM
08-09-2009 05:16 AM - edited 08-09-2009 05:16 AM
smercurio_fc wrote:
It kind of depends on what you're doing. What is in your subVI? If you're displaying an image on a front panel control, and the subVI is closed, I don't know if the avicap32 library will work properly since it needs a window reference to write the image to.
It will and can't work properly. You need to have a valid window for the avicap32.dll to be able to do something. avicap32.dll is the Windows 3.1 way of doing things. It is as such very old and in fact bypassing any modern technology such as DirectX, .Net and whatever by simply plotting directly to the bitmap buffer of the window itself. It is not surprising that the .Net Picture Control box is not aware of that data since what is really happening is that avicap32.dll is simply drawing over the PictureBox instead of into it.
Rolf Kalbermatter
08-09-2009 07:57 AM
11-07-2013 08:22 AM
I know that this problem is old but it is still of interest today.
Based on the ideas and programs presented in the following forums