
SaadJareer
Egypt
Asked
— Edited
Kindly I am having an inquiry about how to use the Camera.GetCurrentBitmap to get the current frame that is shown by a camera device on a PictureBox Control in a C# Form?
When I use the C# code to access the current frame from camera stream, to get a captured image, It always give me a NullReferenceException that the Bitmap Object that is returned from Camera.GetCurrentBitmap method call is just not instantiated.
1) This is almost a duplicated question, please search or scroll down the forum page.
post #1 (3 weeks ago):
http://www.ez-robot.com/Community/Forum/Thread?threadId=9259
post #2 (1 day ago):
http://www.ez-robot.com/Community/Forum/Thread?threadId=9321
2) Aren't you working with Shaimaabes ?
2) read the help summary for the method. The bitmap is only available in the event.
post #1 (3 weeks ago)
I've created an Example Project and is publicly available,
if you study/spend some time understanding the project you see the following code:
Code:
i wait 10 seconds for a frame before saving the picture, when you connect to the camera, the execution is async, there other things going after and when the call returns the camera is not ready.
if you try immediately to get a bitmap or save an image you will get an exception
post #2 (1 day ago)
DJ's wrote:
i was surprised with DJ's comment and if that was the reason to start post #2:
Code:
Not sure how else to explain it - the event is raised for every new frame. If you try to read a bitmap image outside of the frame event, there is no way to know if a frame is actually there or not.