int CTestDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
HRGN hRgn;
RECT rect;
::GetWindowRect(hwnd, &rect);
hRgn = CreateRoundRectRgn(0, 0, rect.right - rect.left + 1, rect.bottom - rect.top + 1, 5,5);
::SetWindowRgn(hwnd, hRgn, TRUE);
}
Void CTestDialog::OnNcPaint()
{
CWindowDC dc(this);
CRect rcWindow;
CRect rcClient;
this->GetClientRect(rcClient);
this->ClientToScreen(rcClient);
this->GetWindowRect(rcWindow);
CPoint point = rcWindow.TopLeft();
rcClient.OffsetRect(-point);
rcWindow.OffsetRect(-point);
int windowWidth = rcWindow.Width();
int windowHeight = rcWindow.Height();
HDC hMemDC = ::CreateCompatibleDC(dc.m_hDC);
HBITMAP hBmp = ::CreateCompatibleBitmap(dc.m_hDC, windowWidth, windowHeight);
::SelectObject(hMemDC, hBmp);
Graphics graphics(hMemDC);
graphics.Clear(Color(255, 255, 255, 255));
graphics.SetSmoothingMode(SmoothingModeHighQuality);
//TODO:使用GDI+的DrawImage函数来贴上圆角图片,或者使用RoundRect函数来为对话框画上圆角线
#if 0 /*使用DrawImage来绘制圆角图片*/
ImageAttributes ia;
ia.SetWrapMode( WrapModeTileFlipXY );
graphic.DrawImage(pImg_LTFrame,……….);
#endif
#if 0 /*使用RoundRect来绘制圆角线*/
RoundRect(hMemDC, rcWindow.left, rcWindow.top, rcWindow.right,rc.bottom, 5, 5 );
#endif
dc.IntersectClipRect(rcWindow);
dc.ExcludeClipRect(rcClient);
::BitBlt(dc.m_hDC, 0, 0, windowWidth, windowHeight, hMemDC, 0, 0, SRCCOPY);
::DeleteDC(hMemDC);
::DeleteObject(hBmp);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有