![]() |
#2
Lyone2011-03-22 10:38
|

pWnd = GetDlgItem(IDC_STC);
Rect = new CRect();
pWnd->GetClientRect(Rect);
pDC = pWnd->GetDC();
RecordDC = new CDC;
RecordDC->CreateCompatibleDC(pDC);
RecordDC->BitBlt(Rect->left,Rect->top,Rect->right,Rect->bottom,pDC,0,0,SRCCOPY);
以上是复制按钮中的代码。Rect = new CRect();
pWnd->GetClientRect(Rect);
pDC = pWnd->GetDC();
RecordDC = new CDC;
RecordDC->CreateCompatibleDC(pDC);
RecordDC->BitBlt(Rect->left,Rect->top,Rect->right,Rect->bottom,pDC,0,0,SRCCOPY);
pDC->BitBlt(Rect->left,Rect->top,Rect->right,Rect->bottom,RecordDC,0,0,SRCCOPY);
OnPaint();
以上是黏贴按钮中的代码OnPaint();
CDC* pDC;
CWnd* pWnd;
CRect* Rect;
CDC* RecordDC;
这个是定义。CWnd* pWnd;
CRect* Rect;
CDC* RecordDC;
IDC_STC是窗口中的一个“框架”类型的图像
为什么实现不了保存图像的功能呢?