15,979
社区成员
发帖
与我相关
我的任务
分享
void CChatDlg::OnPaint()
{
CPaintDC dc(this);
Graphics graphics(dc.GetSafeHdc());
CRect rcClient;
GetClientRect(&rcClient);
//内存图像和内存Graphics
Bitmap bmp(rcClient.Width(), rcClient.Height());
Graphics* buffergraphics = Graphics::FromImage(&bmp);
//画标题栏,即自己定制的标题栏
DrawHeadClient(buffergraphics, rcClient);
//把绘好的图从内存画到屏幕
graphics.DrawImage(&bmp, 0, 0, rcClient.Width(), rcClient.Height());
delete buffergraphics;
graphics.ReleaseHDC(dc.GetSafeHdc());
ReleaseDC(&dc);
}