ive just wondered how i can take a snapshot of my webcam after listing all available sources. So I searched for this topic, but did not really find it.
Can someone give me any advice how to do that, maybe by an conde example?
By the way:
I want to be able to access this image via char * and any FileSize variable.
// create the preview window
HWND hCam = capCreateCaptureWindow(
"hoven",
WS_CHILD,
0, 0, 0, 0,
::GetDesktopWindow(), 0);
// connect to the first camera
// for other cameras try index
// 1, 2, in place of the 0 below
if(capDriverConnect(hCam, 0))
{
capFileSaveDIB(hCam, "shot.bmp");
// the screenshot is in the current
// directory, usually the same
// where the exe is created by
// your compiler
printf("Saved as shot.bmp!");
}
else
{
printf("Check camera?");
}
The problem is, that i want to get this image as char * and not save it into a file and i didnt find anything according to that topic...