OpenClipboard
- From: "Martin" <mrbiancu@xxxxxxxxx>
- Date: 8 Jun 2006 11:30:42 -0700
Hi, I have the following code:
BOOL CVideo::CaptureFrame()
{
HBITMAP m_hBmp = NULL;
CBitmap m_bmp; //bitmap object
capGrabFrame(hWndC); // macro that sample a single frame from the
// camera.
capEditCopy(hWndC);
EmptyClipboard();// simple macro that edit a copy of the frame.
OpenClipboard();
// m_hBmp is a Handle to Bitmap.
m_hBmp = (HBITMAP)::GetClipboardData(CF_BITMAP);
CloseClipboard();
m_bmp.Detach(); //cleaning the bitmap.
m_bmp.Attach(m_hBmp); //connecting the bitmap throw the handle.
return true;
}
I call this function when i want to capture a frame. But, when I call
OpenClipboar, an assertion failure window is pop out, and the program
fails.
Can anybody please explain why the OpenClipboard function fails?
I want to save a .bmp file. I could save a avi frame using the
following statements:
capFileSetCaptureFile(hWndC, "c:\\myCapturedFrame");
capCaptureSingleFrameOpen(hWndC);
capCaptureSingleFrame(hWndC);
capCaptureSingleFrameClose(hWndC);
but that pice of code generates an myCaptureFrame.avi, but I need a
..bmp file.
Thanks for your time.
.
- Follow-Ups:
- Re: OpenClipboard
- From: Joseph M . Newcomer
- Re: OpenClipboard
- Prev by Date: Re: Initialize Second Dialog
- Next by Date: Re: Function Call Problem
- Previous by thread: how to setup global keyboard hook to stop alt-enter on a folder
- Next by thread: Re: OpenClipboard
- Index(es):
Relevant Pages
|