if ( OpenClipboard() )
{
EmptyClipboard();
//create some data
CBitmap * junk = new CBitmap();
CClientDC cdc(this);
CDC dc;
dc.CreateCompatibleDC(&cdc);
CRect client(0,0,200,200);
junk->CreateCompatibleBitmap(&cdc,client.Width(),client.Height());
dc.SelectObject(junk);
//call draw routine here that makes GDI calls
DrawImage(&dc,CString("Bitmap"));
//put the data on the clipboard
SetClipboardData(CF_BITMAP,junk->m_hObject);
CloseClipboard();
//copy has been made on clipboard so we can delete
delete junk;
}
中间的 DrawImage(&dc,CString("Bitmap")) 函数没定义!
好象是GDI的函数,不知道要加什么头文件的。不大清楚,请各位指教!
{
EmptyClipboard();
//create some data
CBitmap * junk = new CBitmap();
CClientDC cdc(this);
CDC dc;
dc.CreateCompatibleDC(&cdc);
CRect client(0,0,200,200);
junk->CreateCompatibleBitmap(&cdc,client.Width(),client.Height());
dc.SelectObject(junk);
//call draw routine here that makes GDI calls
DrawImage(&dc,CString("Bitmap"));
//put the data on the clipboard
SetClipboardData(CF_BITMAP,junk->m_hObject);
CloseClipboard();
//copy has been made on clipboard so we can delete
delete junk;
}
中间的 DrawImage(&dc,CString("Bitmap")) 函数没定义!
好象是GDI的函数,不知道要加什么头文件的。不大清楚,请各位指教!
Header Declared in Gdiplusgraphics.h, include gdiplus.h
Import library gdiplus.lib
Minimum availability GDI+ 1.0
Minimum operating systems Windows 98/Me, Windows XP, Windows 2000, Windows NT 4.0 SP6
先要包含GDI+的头文件,
然后要使用命名空间。
然后要初始化GDI+。
然后才能使用