I get Bitmap (25 per 1 second) from a camera using imageAvailable envent. I have to show it on a GUI and also procees that Bitmap. So I am using two bitmaps, one for the live and the other for the processing. The problem is I am getting the invalidOperationException (and it saying "Object is in use currently elsewhere") while I am processing "currentFrame2". For live I am uisng "currentFrame", there is nor problem.
currentFrame = (Bitmap)e.ImageBuffer.Bitmap.Clone();
currentFrame2 = currentFrame;
I was looking at
- Bitmap.Save "Object is currently in use elsewhere" Threading Issue
- Accessing an object on 2 threads at the same time
The above links couldn't help.
Please give me a suggesion to overcome this problem.
Thank you