VC创建圆角窗体
来源:互联网 发布:淘宝的淘气值是干嘛的 编辑:程序博客网 时间:2024/05/19 23:15
有时候根据具体需求,我们可能要改变窗口的形状。使用API函数SetWindowRgn可以改变一个窗体的可见范围。
使用API函数CreateRoundRectRgn()函数可以创建一个圆角矩形区域。
图片ID为:IDB_BACKBMP
BOOL CDemoDlg::OnInitDialog(){CDialog::OnInitDialog();// Set the icon for this dialog. The framework does this automatically// when the application's main window is not a dialogSetIcon(m_hIcon, TRUE);// Set big iconSetIcon(m_hIcon, FALSE);// Set small icon// TODO: Add extra initialization herem_back.LoadBitmap(IDB_BACKBMP);CRgn rgn;rgn.CreateRoundRectRgn(3,3,700,650,20,20);SetWindowRgn(rgn,TRUE);return TRUE; // return TRUE unless you set the focus to a control}void CDemoDlg::OnPaint() {CPaintDC dc(this); // device context for paintingCDC picDC;picDC.CreateCompatibleDC (&dc);CBitmap *pOldBmp;pOldBmp = picDC.SelectObject (&m_back);BITMAP bm;m_back.GetBitmap(&bm);dc.BitBlt (0,0,bm.bmWidth ,bm.bmHeight,&picDC,0,0,SRCCOPY);dc.SelectObject(pOldBmp); }
void OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // TODO: 在此处添加消息处理程序代码 CRgn MyRgn; CRect rect; GetWindowRect(&rect); rect -= rect.TopLeft(); MyRgn.CreateRoundRectRgn(rect.left,rect.top, rect.right, rect.bottom, 3,3); SetWindowRgn(MyRgn,TRUE); }
0 0
- VC创建圆角窗体
- VC创建圆角窗体2
- vc创建窗体
- VC++创建popup窗体
- 创建圆角窗体
- vb 创建圆角窗体
- C# 创建圆角窗体代码
- VB.NET 创建圆角窗体
- 使用API创建窗体(类似VC的创建过程)
- 使用API创建窗体(类似VC的创建过程)
- 开始VC之路--创建窗体
- 开始VC之路--创建窗体
- 用VC++6.0创建有玻璃透明特效的窗体
- WPF换肤之一:创建圆角窗体
- 创建窗体
- 创建窗体
- 创建窗体!
- 窗体创建
- 移动修改版
- Cocos2d-JS 使用 scheduler 小结
- android自带下拉刷新
- Django数据库操作
- 无题
- VC创建圆角窗体
- 使用 Ant 打包 Android 应用
- 20090627u-boot IXDP425
- Oracle 11g R2在windows 7(32)上安装后的几个服务说明
- 杭电1002_C语言
- 利用intent打开图片库
- cmake编译时遇到的问题解决
- 手机吸费设备 加盟电话平台 声讯电话加盟
- u-boot timeline