Clipboard问题
Hi All,I am trying to save the clipboard content as a bmp file. I tried like this:
GLOBALHANDLE hGMem = (GLOBALHANDLE)::GetClipboardData (CF_METAFILEPICT);
LPMETAFILEPICT lpMFP = (LPMETAFILEPICT)GlobalLock(hGMem);
HDC hDc= ::GetDC(::GetDesktopWindow ());
HDC hMemDC = ::CreateCompatibleDC(hDc);
HBITMAP hBitmap =::CreateCompatibleBitmap(hDc, 800, 600);
HGDIOBJ hOldBitmap = ::SelectObject(hMemDC, hBitmap);
int nOldeMap = ::SetMapMode(hMemDC, lpMFP->mm);
BOOL bResult = PlayMetaFile(hMemDC, lpMFP->hMF);bResult;
::SetMapMode(hMemDC, nOldeMap);
hBitmap = (HBITMAP)::SelectObject(hMemDC, hOldBitmap);
I am getting blank image only. Can anyone help me where i went wrong??
Thanks in advance,
Kalicy --------------------编程问答-------------------- System.Drawing.Rectangle rect = this.panVeloProfile.ClientRectangle;
bitmap = new Bitmap(rect.Width, rect.Height);
Graphics g = Graphics.FromImage(velofilemap);
g.Clear(Color.White); //add this the bitmap will white backgroud
补充:.NET技术 , VC.NET