Capturing camera with video for windows
recantly ive bought myself small pc camera from creative. ive done some simple experiments using it with flash, where it is easy to create nice effects with just a litte work. mainly i wanted to reproduce incopmet.com experiments. but ive found something that could be more interesting.
my idea was to write application using VfW (video for windows) to capture camera image. in MSDN we can read that it is possible to manipulate image from camera before it is displayed in capture window. this can be done by setting frame callback function, that can be registered for a specified capture window using capSetCallbackOnFrame macro (defined in wfv.h). to use this macro we need to define call back function
LRESULT CALLBACK capVideoStreamCallback(HWND hWnd, LPVIDEOHDR lpVHdr)that we will use to manipulate camera image. second parameter of our function contains image data we want to work on. to manipulate frame we need to know the image format used by camera (that is how many bits are used to define single color). to get this information we can use this function :
DWORD capGetVideoFormat( HWND hwnd, LPBITMAPINFO psVideoFormat, DWORD wSize )here is sample image that has been created using my minimal camera capture application


1