使用gdi+裁剪圆形图像
2016-02-23 09:54
288 查看
Image image(strPath);
RECT pos = GetPos();
RECT padding = GetPadding();
HRGN rgn = CreateEllipticRgn(pos.left,pos.top,pos.right,pos.bottom);
Region region(rgn);
Graphics graph(hDC);
SolidBrush greenBrush(Color(255,255,255,255)); ;
Rect rc2(pos.left,pos.top,pos.right-pos.left-2,pos.bottom-pos.top-2);
graph.SetClip(®ion,CombineModeReplace);
graph.DrawImage(&image,padding.left,padding.top);
Graphics graph1(hDC);
graph1.SetSmoothingMode(SmoothingModeHighQuality);
graph1.DrawEllipse(&Pen(Color::White,2),rc2);
RECT pos = GetPos();
RECT padding = GetPadding();
HRGN rgn = CreateEllipticRgn(pos.left,pos.top,pos.right,pos.bottom);
Region region(rgn);
Graphics graph(hDC);
SolidBrush greenBrush(Color(255,255,255,255)); ;
Rect rc2(pos.left,pos.top,pos.right-pos.left-2,pos.bottom-pos.top-2);
graph.SetClip(®ion,CombineModeReplace);
graph.DrawImage(&image,padding.left,padding.top);
Graphics graph1(hDC);
graph1.SetSmoothingMode(SmoothingModeHighQuality);
graph1.DrawEllipse(&Pen(Color::White,2),rc2);
相关文章推荐
- How to concatenate two matrices in Python?
- 使用UDP发送数据简单实现
- java spring mvc时间String转Date(二)
- python爬虫(抓取百度新闻列表)
- htm5移动端开发 和 pc端开发
- Fiddler 会拉弦的程序员
- Android Weak Handler:可以避免内存泄漏的Handler库
- 视图的优缺点
- 257. Binary Tree Paths
- Java transient关键字使用
- 版本号V1*.V2*.V3*.V4* 第四位从svn versioon同步
- 深度学习edusoho之前端插件
- 2016.02.23,英语,《Vocabulary Builder》Unit 01
- CocoaPods安装使用及配置私有库
- MIME协议
- CodeForces 629C Famil Door and Brackets
- easyUI-tree
- bat脚本批量输出文件夹名
- idea Context: local file . file is included in 3 contexts
- Android--数据库数据显示至屏幕