本文主要是介绍VC 窗体非客户区的绘制 OnNcPaint(UINT message, WPARAM wParam, LPARAM lParam),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
void CSkinAndLangDlg::OnNcPaint(UINT message, WPARAM wParam, LPARAM lParam)
{HDC WindowDC = ::GetWindowDC(m_hWnd);
// //取得整个窗体矩形RECT WindowRect;GetWindowRect(&WindowRect);OffsetRect(&WindowRect, -WindowRect.left, - WindowRect.top);
// //取得客户区矩形,并从WINDOWDC中排除不予绘制
// RECT ClientRect;
// GetClientRect(&ClientRect);
// OffsetRect(&ClientRect, BorderLeftWidth, BorderTopHeight);
// ExcludeClipRect(WindowDC, ClientRect.left, ClientRect.top, ClientRect.right, ClientRect.bottom);//窗体宽度和高度
// int width, height;
// width = WindowRect.right;
// height = WindowRect.bottom;
// //填充背景
// Bitmap bmp(width, height);
// Graphics* g = Graphics::FromImage(&bmp);
// SolidBrush sbr(Color(255,120,120,120));
// g->FillRectangle(&sbr, 0, 0, width, height);
//
// Image *pImage = NULL;
// skinApp.LoadPng(1, (void*&)pImage);
//
// g->DrawImage(pImage, 0, 0);// int x_CtrBox = width
这篇关于VC 窗体非客户区的绘制 OnNcPaint(UINT message, WPARAM wParam, LPARAM lParam)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!