I've extracted this from an existing project that worked with PhotoTraveler CF. I could share the rest but you would have to dig through it - it was a two-night job for a rush demo.
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamOpen(out IntPtr phCam);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamClose(IntPtr hCam);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamStartPreview(IntPtr hCam, IntPtr previewhwnd);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamPreviewDatatoRGB24(IntPtr hCam, CamResolution resolution, byte[] buffprev, int length, byte[] buffrgb24);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamPreviewData(IntPtr hCam, byte[] buff, out int length);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamPreviewDatatoJPG(IntPtr hCam, CamResolution resolution, byte[] buffprev, int length, byte[] buffjpg, ref int jpglength);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamStopPreview(IntPtr hCam);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamStartSnapshot(IntPtr hCam, string filename, CamResolution resolution);
[DllImport("veocamapi.dll")]
static public extern CAM_ERRORS CamSetPreviewResolution(IntPtr hCam, CamResolution resolution);
}
public enum CAM_ERRORS
{
E_NOERR =0, //No error
E_NOCAM, //No Camera
E_NOMEMORY, //No enough memory
E_ERRPARAMETER, //Input parameter is wrong
E_NOSUPPORTTED, //This function is not supported in current driver
E_DECODE, //Error during decode
E_OTHERERR //Other unknown error
};
public enum WhiteBalance
{
ENV_AWB =1, //Auto white balance
ENV_FLUORESCENT, //Fluorescent light
ENV_INCANDESCENT, //Incandescent light
ENV_OUTDOOR //Outdoor light
};
public enum CamResolution
{
RES_640 =1, //VGA 640x480 Resolution, only supported in snapshot
RES_320, //QVGA 320x240 Resolution, supported in snapshot and preview
RES_160 //QQVGA 160x120 Resolution, supported in snapshot and preview
};