Silverlight 引路蜂二维图形库示例:多义线和多边形
来源:互联网 发布:java如何调用api接口 编辑:程序博客网 时间:2024/04/30 06:23
Graphics2D提供了FillPolygon ,drawPolyline来填充和绘制多边形和多义线
private void Polys(){ AffineTransform mat1; /** Colors */ Color redColor = new Color(0x96ff0000, true); Color greenColor = new Color(0xff00ff00, false); Color blueColor = new Color(0x750000ff, true); Polyline polyline; Polygon polygon; Polygon polygon1; string pointsdata1 = "59,45,95,63,108,105,82,139,39,140,11,107,19,65"; mat1 = new AffineTransform(); mat1.Translate(130, 140); mat1.Rotate(-30 * Math.PI / 180.0); polyline = new Polyline(); polygon = new Polygon(); polygon1 = new Polygon(); Point[] points = Point.FromString(pointsdata1); for (int i = 0; i < points.Length; i++) { polyline.AddPoint(points[i].X, points[i].Y); polygon.AddPoint(points[i].X, points[i].Y); polygon1.AddPoint(points[i].X, points[i].Y); } //Clear the canvas with white color. graphics2D.Reset(); graphics2D.Clear(Color.White); graphics2D.AffineTransform = new AffineTransform(); SolidBrush brush = new SolidBrush(greenColor); graphics2D.FillPolygon(brush, polygon); graphics2D.AffineTransform = mat1; brush = new SolidBrush(blueColor); Pen pen = new Pen(redColor, 5); graphics2D.SetPenAndBrush(pen, brush); graphics2D.FillPolygon(null, polygon1); graphics2D.DrawPolyline(null, polyline);}
- Silverlight 引路蜂二维图形库示例:多义线和多边形
- Silverlight 引路蜂二维图形库示例:不同线宽
- Silverlight 引路蜂二维图形库示例:概述
- Silverlight 引路蜂二维图形库示例:包定义
- Silverlight 引路蜂二维图形库示例:基本知识
- Silverlight 引路蜂二维图形库示例:绘制各种几何图形
- Silverlight 引路蜂二维图形库示例:颜色
- Silverlight 引路蜂二维图形库示例:虚线类型
- Silverlight 引路蜂二维图形库示例:椭圆
- Silverlight 引路蜂二维图形库示例:路径
- Silverlight 引路蜂二维图形库示例:坐标变换
- Silverlight 引路蜂二维图形库示例:颜色渐变
- Silverlight 引路蜂二维图形库示例:材质画刷
- Silverlight 引路蜂二维图形库示例:显示位图
- Silverlight 引路蜂二维图形库示例:动画Beziers曲线
- Silverlight 引路蜂二维图形库示例:矢量字体
- Silverlight 引路蜂二维图形库示例:结束语
- Silverlight 引路蜂二维图形库示例:线段末端形状(LineCap)
- Android ApiDemos示例解析(27):App->Notification->Notifying Service Controller
- Discuz X2安装实录
- 无缝漫游 Seamless Roaming
- WLAN Roaming - the basics Even if you keep the same IP address, things get complicated.
- (深入)进程上下文和中断上下文
- Silverlight 引路蜂二维图形库示例:多义线和多边形
- 802.11 WLAN 中省电(Power Saving)的一些参数解说
- Block Communications between Wireless PCs (Privacy Separator)
- Linux:crosstool-ng制作自己的交叉编译工具
- 关于指令test ecx,ecx
- Java ME引路蜂地图开发示例:地图平移
- SyntaxError: Non-ASCII character Python、Unicode和中文
- 驱动开发之二:尝试挂接file system
- Android OpenGL ES->GLSurfaceView