基本信息
源码名称:切割部分对话框
源码大小:76.89M
文件格式:.zip
开发语言:C/C++
更新时间:2020-12-09
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
// 但在任务条的按钮中仍需要标题
SetWindowText(_T("椭圆窗口"));
// 取得屏幕宽、高
int cxScreen = ::GetSystemMetrics(SM_CXSCREEN);
int cyScreen = ::GetSystemMetrics(SM_CYSCREEN);
// 设置椭圆X、Y方向的半径
int nEllipseWidth = cxScreen / 8;
int nEllipseHeight = cyScreen / 8;
// 将窗口大小设为宽nEllipseWidth,高nEllipseHeight
// 并移至左上角
CRect rect;
GetWindowRect(&rect);
ScreenToClient(&rect);
//GetClientRect(&rect);
//MoveWindow(0, 0, 1000, 1000);
// 创建椭圆区域m_rgnWnd
//m_rgnWnd.CreateEllipticRgn(0, 0, nEllipseWidth, nEllipseHeight);
CPoint *pt = new CPoint[6];
//CPoint pt[6];
pt[0].x = rect.left;
pt[0].y = rect.top;
pt[1].x = rect.right;
pt[1].y = rect.top;
pt[2].x = rect.right;
pt[2].y = (rect.top rect.bottom)/2;
pt[3].x = (rect.left rect.right)/2;
pt[3].y = (rect.top rect.bottom) / 2;
pt[4].x = (rect.left rect.right) / 2;
pt[4].y = rect.bottom;
pt[5].x = rect.left;
pt[5].y = rect.bottom;
CArray <CPoint, CPoint&> m_Array;
m_Array.SetSize(6, 10);
CPoint pt1(rect.left, rect.top);
m_Array.Add(pt1);
CPoint pt2(rect.right, rect.top);
m_Array.Add(pt2);
CPoint pt3(rect.right, (rect.top rect.bottom) / 2);
m_Array.Add(pt3);
CPoint pt4((rect.left rect.right) / 2, (rect.top rect.bottom) / 2);
m_Array.Add(pt4);
CPoint pt5((rect.left rect.right) / 2, rect.bottom);
m_Array.Add(pt5);
CPoint pt6(rect.left, rect.bottom);
m_Array.Add(pt6);
m_rgnWnd.CreatePolygonRgn(pt, 6, ALTERNATE);
// 将m_rgnWnd设置为窗口区域
SetWindowRgn((HRGN)m_rgnWnd, TRUE);
delete(pt);
/ TODO: 在此添加额外的初始化代码
// 设置窗口标题为“椭圆窗口”,虽然对话框没有标题条,// 但在任务条的按钮中仍需要标题
SetWindowText(_T("椭圆窗口"));
// 取得屏幕宽、高
int cxScreen = ::GetSystemMetrics(SM_CXSCREEN);
int cyScreen = ::GetSystemMetrics(SM_CYSCREEN);
// 设置椭圆X、Y方向的半径
int nEllipseWidth = cxScreen / 8;
int nEllipseHeight = cyScreen / 8;
// 将窗口大小设为宽nEllipseWidth,高nEllipseHeight
// 并移至左上角
CRect rect;
GetWindowRect(&rect);
ScreenToClient(&rect);
//GetClientRect(&rect);
//MoveWindow(0, 0, 1000, 1000);
// 创建椭圆区域m_rgnWnd
//m_rgnWnd.CreateEllipticRgn(0, 0, nEllipseWidth, nEllipseHeight);
CPoint *pt = new CPoint[6];
//CPoint pt[6];
pt[0].x = rect.left;
pt[0].y = rect.top;
pt[1].x = rect.right;
pt[1].y = rect.top;
pt[2].x = rect.right;
pt[2].y = (rect.top rect.bottom)/2;
pt[3].x = (rect.left rect.right)/2;
pt[3].y = (rect.top rect.bottom) / 2;
pt[4].x = (rect.left rect.right) / 2;
pt[4].y = rect.bottom;
pt[5].x = rect.left;
pt[5].y = rect.bottom;
CArray <CPoint, CPoint&> m_Array;
m_Array.SetSize(6, 10);
CPoint pt1(rect.left, rect.top);
m_Array.Add(pt1);
CPoint pt2(rect.right, rect.top);
m_Array.Add(pt2);
CPoint pt3(rect.right, (rect.top rect.bottom) / 2);
m_Array.Add(pt3);
CPoint pt4((rect.left rect.right) / 2, (rect.top rect.bottom) / 2);
m_Array.Add(pt4);
CPoint pt5((rect.left rect.right) / 2, rect.bottom);
m_Array.Add(pt5);
CPoint pt6(rect.left, rect.bottom);
m_Array.Add(pt6);
m_rgnWnd.CreatePolygonRgn(pt, 6, ALTERNATE);
// 将m_rgnWnd设置为窗口区域
SetWindowRgn((HRGN)m_rgnWnd, TRUE);
delete(pt);