View Full Version : Store Image Data in Variable, Loading a Image File

November 4, 2011, 14:39:44

I am just start working with Imaginesource DFK 22BUC03 camera with IC Imaging Control 3.2 in C#.
I only found Image Buffer ring to acess the Image Data. Is there any way to load/Save Image (1 frame data) to a variable to use later in the program as well as load Image file to a Variable to compare Image with captured Image (Image Buffer)?

I was trying Unlock and Lock Image buffer, but it gives some error in C#, It will be better if there is a Data Type for Image frame to store and use it in program.

In My program I need to grab a YUV Image beginning of the program starting (which will work as a background) and save it to a variable so that I can use it all the time. As well as I need to load a Image background file to a variable to compare it with image buffer.

Thanks advance for helping me.


Stefan Geissler
November 4, 2011, 16:19:04

Lock and Unlock is the intended way to do, what you want to do. What errors do you receive?
Alternatively you can use the Bitmap property of the ImageBuffer in order to copy the image buffer into a System.Drawing.Bitmap object. You must do a real copy, not only an assignment. This should be done somehow using the System.Drawing.Bitmap constructor.