Silverlight 引路蜂二维图形库示例:多义线和多边形

Silverlight 引路蜂二维图形库示例:多义线和多边形,第1张

概述Graphics2D提供了FillPolygon ,drawPolyline来填充和绘制多边形和多义线 private void Polys(){ AffineTransform mat1; /** Colors */ Color redColor = new Color(0x96ff0000, true); Color greenColor = new Color(0xff00ff00

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 引路蜂二维图形库示例:多义线和多边形所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1067059.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存