silverlight   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Silverlight 引路蜂二维图形库示例:多义线和多边形大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

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 引路蜂二维图形库示例:多义线和多边形全部内容,希望文章能够帮你解决Silverlight 引路蜂二维图形库示例:多义线和多边形所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。