Silverlight 引路蜂二维图形库示例:线段连接类型(LineJoin)

jerry Silverligth 2015年11月26日 收藏

线段连接类型(LineJoin)指定了线段了连接的方式,有三种不同的连接类型JOIN_MITER, JOIN_ROUND和OIN_BEVEL。

下面类型显示了三种不同的LineJoin类型。

private void LineJoin()
{
 Color blackColor = new Color(0x000000);
 Color whiteColor = new Color(0xffffff);
 Path path = new Path();
 path.MoveTo(40, 80);
 path.LineTo(90, 40);
 path.LineTo(140, 80);
 graphics2D.Reset();
 graphics2D.Clear(Color.White);

 AffineTransform matrix = new AffineTransform();
 graphics2D.AffineTransform = matrix;
 Pen pen = new Pen(blackColor, 20, Pen.CapButt, Pen.JoinMiter);
 graphics2D.Draw(pen, path);
 pen = new Pen(whiteColor, 1);
 graphics2D.Draw(pen, path);
 matrix.Translate(0, 50);
 graphics2D.AffineTransform = matrix;

 pen = new Pen(blackColor, 20, Pen.CapButt, Pen.JoinRound);
 graphics2D.Draw(pen, path);
 pen = new Pen(whiteColor, 1);
 graphics2D.Draw(pen, path);

 matrix = new AffineTransform();
 matrix.Translate(0, 100);
 graphics2D.AffineTransform = matrix;

 pen = new Pen(blackColor, 20, Pen.CapButt, Pen.JoinBevel);
 graphics2D.Draw(pen, path);
 pen = new Pen(whiteColor, 1);
 graphics2D.Draw(pen, path);
}