Click to See Complete Forum and Search --> : DeviceIOControl Camera..


OGLESS
May 19th, 2006, 03:59 PM
Hi all,

I have the output from DeviceIOControl when trying to take a picture using a camera; something like this:

if (DeviceIoControl(Camera_FileHandle, IOCTL_OEM_CAM_CAPTURE, &vinFrame, sizeof(VINFRAMEINFO), Camera_CaptureYUV2, CAMERA_CAPTURE_SIZEBYTES, &cbRet, NULL))
return true;
}

I can also dump the output as a file, but how can I convert this into a picture ?

Thanks in advance,
OGLESS

JamesSchumacher
May 19th, 2006, 05:03 PM
Check out http://msdn.microsoft.com/library and search up on:

BITMAPFILEHEADER
BITMAPINFOHEADER (BITMAPV4HEADER, BITMAPV5HEADER)

If you convert the data into RGBQUAD values, you should be easily able to write this out to a bitmap.

Alternately - you could create a DIBSECTION with a handle to a file mapping object. The copy your pixel data into the bitmap. :p

OGLESS
May 20th, 2006, 08:13 AM
Thanks so much JamesSchumacher! I tried many places, but to no avail.. :(

I'll follow up your guidance, and return here if I have any more troubles (no doubt :P )

- OGLESS

OGLESS
May 20th, 2006, 08:22 AM
Hmmm, "If you convert the data into RGBQUAD values"..

You wouldn't happen to know what format the current output of DeviceIOControl, is ?

Need to know what Im converting from first :P

OGLESS
May 26th, 2006, 07:04 AM
Anyone ?

Unfortunately, there's not much (any :P ) other place I can get help from..