GDI+入门01
来源:互联网 发布:护眼仪哪个牌子好 知乎 编辑:程序博客网 时间:2024/06/08 05:14
本文章主要是来自http://blog.csdn.net/bobui/article/details/5136635
自己看了楼主的文章后在加上自己的理解,决定在此基础上完善下,以供大家学习。
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;//消除锯齿
g.FillRectangle(Brushes.Wheat, this.ClientRectangle);
Pen myPen1 = new Pen(Color.Red, 10);
myPen1.LineJoin = LineJoin.Bevel;//指定成斜角的链接
Rectangle r = new Rectangle(20, 10, 60, 60);
g.DrawRectangle(myPen1, r);
Pen myPen2 = new Pen(Color.Red, 10);
myPen2.LineJoin = LineJoin.Miter;//产生锐角或切除脚
g.DrawRectangle(myPen2, 100, 10, 60, 60);
Pen myPen3 = new Pen(Color.Red, 10);
myPen3.LineJoin = LineJoin.MiterClipped;//产生锐角或者斜角
g.DrawRectangle(myPen3, 20, 100, 60, 60);
Pen myPen4 = new Pen(Color.Red, 10);
myPen4.LineJoin = LineJoin.Round;//圆形连接
g.DrawRectangle(myPen4, 100, 100, 60, 60);
效果图如下:
在此我也对Miter和MiterClipped属性做了对比:
代码如下:
Point point1 = new Point(50, 50);
Point point2 = new Point(100, 25);
Point point3 = new Point(200, 5);
Point point4 = new Point(250, 50);
Point point5 = new Point(300, 100);
Point point6 = new Point(350, 200);
Point point7 = new Point(250, 250);
Point[] p ={
point1,
point2,
point3,
point4,
point5,
point6
};
Pen myPen1 = new Pen(Color.Red, 10);
myPen1.LineJoin = LineJoin.Miter;
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
g.DrawPolygon(myPen1, p);
Point point11 = new Point(50, 50);
Point point12 = new Point(100,25);
Point point13 = new Point(200, 5);
Point point14 = new Point(250, 50);
Point point15 = new Point(300, 100);
Point point16 = new Point(350, 200);
Point point17 = new Point(250, 250);
Point[] pp ={
point11,
point12,
point13,
point14,
point15,
point16,
point17
};
g.TranslateTransform(500, 0);
Pen myPen2 = new Pen(Color.Red, 10);
myPen2.LineJoin = LineJoin.MiterClipped;
g.DrawPolygon(myPen2, pp);
效果图如下:
实在没找出什么区别,如果大家有什么意见或者方法可以告诉我下,先谢谢大家了。
本人也是最近才学习GDI+,如有不对之处请大家指正。
- GDI+入门01
- GDI&GDI+程序入门
- GDI+入门
- GDI+入门
- GDI+入门
- GDI+入门
- GDI+入门
- GDI+入门
- GDI+入门(Starting with GDI+)
- GDI+ 简单入门学习
- GDI+入门(总结)
- GDI+ 基础知识入门
- GDI+入门(总结)
- GDI+ 入门编程
- GDI简明入门
- Gdi+实用入门
- 《GDI/GDI+从入门到精通》视频教程
- Window GDI入门初阶
- UIKit和CoCos2d 两种情况下 Retina模式图片的命名方法区别
- Nutch爬虫工作流程及文件格式详细分析
- 43.VC(custom)-richedit实现超链接(随手代码)
- 指针(二)
- 【VC编译问题】如何解决VC中的警告Warning C4251
- GDI+入门01
- 堆栈调用解析多线程
- wsdl
- LoadError (no such file to load — openssl)
- linux设备驱动--非阻塞IO与select,poll调用 (续1)
- Objective-c - nil, Nil, NULL和NSNull
- 为Ubuntu配置ssh服务
- [算法导论读书笔记]堆排序,优先队列
- pythonchallenge通关记录