首页
诗词
字典
板报
句子
名言
友答
励志
学校
网站地图
图形图像
Photoshop
CorelDRAW
IIIustrator
InDesign
图形图像
Freehand
当前位置:
首页
>
教程频道
>
平面设计
>
图形图像
>
Silverlight 指路蜂二维图形库示例:多义线和多边形
2012-06-20
Silverlight 引路蜂二维图形库示例:多义线和多边形Graphics2D提供了FillPolygon ,drawPolyline来填充和绘
Silverlight 引路蜂二维图形库示例:多义线和多边形
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);}
查看更多
下一篇
本文网址:
https://www.reader8.net/jiaocheng/20120620/2094118.html
读书人精选
热点排行
使用xml及java代码混同的方式来设置图形
UIImage 图片处理:截图,缩放,设定大小
解决linux系统启动之:root用户经过验证但
图像瓜分之(六)交叉视觉皮质模型(ICM
LIRe 源代码分析 六:检索(ImageSearch
给UIImageView添手势
Java的jfreechat 图形表格例子
念交几个美工朋友,有意者请进
[google面试CTCI] 1-6.图像旋转有关问题
黑马软件工程师_<<GUI(图形用户界面)-1>