Camera Capture + GPS in C#

Kaif Ansari
Attachment: clsCamera.zip (1.44 KB)
I finished my project logging GPS data and image capture from CAM130 in
WinCE6.0,it store 1 image and gps data per second. Logging GPS data is easy
using serial port but problem is to capture image. So I upload a camera
capture class in c sharp. it will be helpfull for those, who are working on
the same type of project.

Kaif Ansari
India

A.G
Call to DeviceIoControl with CAM_IOCTL_GET_LATEST_FRAME parameter, always
return false. Where is the source of problem?

tungnh
hi Kaif Ansari
Can you share all your code? thanks

A.G
I used the code as below for using your clsCamera class:

Camera camera = new Camera();
camera.CaptureImage("test.jpg");

Call to DeviceIoControl in CaptureImage returns false.
I am using  WinCE 5.0, did you test the code in WinCE 5.0?

Kaif Ansari
Check the value return in class construtor(rt=DeviceIoControl(camDriver,
CAM_IOCTL_MOVIE_START, null, 0, null, 0, ref bytesReturned, IntPtr.Zero).

is your camera capture image in CamTest App provided in bsp?

A.G
DeviceIoControl with CAM_IOCTL_MOVIE_START returns true. 
CamTest App doesn't work but the mini2440 test application works fine and
also linux CamTest version works too.

Kaif Ansari
I test this application in WinCE6.0,  check the constant
CAM_IOCTL_GET_LATEST_FRAME value in
"C:\WINCE600\PLATFORM\Mini2440\SRC\DRIVERS\Camera\Camera.h" for WinCE5

Devesh Rai
Hey Kaif! Good stuff here, I used your camera application to play around
with the camera a little. I find that in C#, it is very slow to perform the
little image processing that I wanted to do. Do you know how to use the
camera using c++? Could you point me towards some sample code for the same?

Thanks in advance,

Tom
A.G, i have the same problem, have you solved it?

Is there available source code of cameratest.exe?

Ferite
Hi.

This class works very well. Does some one has changed the picture size?. I
need an image of at least 320x240.

Thanks.

Bahar Ali
Hi Kaif! 
your code works gr8. thanks for sharing:)

HTBT
Hi kaif ansari
megatons of thanks for sharing code.
I want to know how to capture in less than a second?
for example capturing in every 0.2 second?
does anyone test it?

Nui
Hi Kaif! 
I search this file for 2 week haha thanks you very much.

mary
Error Open Camera

mary
CreateFile("CIS1:", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ |
FILE_SHARE_WRITE, IntPtr.Zero,
                OPEN_EXISTING, 0, IntPtr.Zero);