0
点赞
收藏
分享

微信扫一扫

生成GraphicsPath

//gp.PathData

GraphicsPathIterator gpi = new GraphicsPathIterator(gp);

int start, end, count = 0;

count = gpi.NextMarker(out start, out end);

PointF[] points = new PointF[count];

byte[] types = new byte[count];

gpi.CopyData(ref points, ref types, start, end);

sb.Append(string.Format("GraphicsPath path{0} = new GraphicsPath(\r\n", c));

sb.Append("new PointF[] {\r\n");

for (int i = 0; i < points.Length; i++)

{

sb.Append(String.Format("new PointF({0}F,{1}F)", points[i].X, points[i].Y));

if (i != points.Length - 1) sb.Append(",");

}

sb.Append(@"},

new System.Byte[] {

");

for (int i = 0; i < types.Length; i++)

{

sb.Append(types[i].ToString());

if (i != types.Length - 1) sb.Append(",");

}

sb.Append(" });\r\n");

//resultGP.AddPath(gp, false);

//g.FillPath(Brushes.Red, gp);

//sb.Append(gp.ToString());

举报

相关推荐

0 条评论