private void InitShape() { float[] pts = new float[] { 64f, 64f, 192f, 64f, 576f, 320f, 64f, 320f }; ShapePoint[] sp = new ShapePoint[4]; shape = new ShapeLinesCollection(); for (int i = 0; i < 4; i++) { sp[i] = new ShapePoint(pts[i * 2], pts[i * 2 + 1]); } shape.Add(new ShapeLine(sp[0], sp[1])); shape.Add(new ShapeLine(sp[1], sp[2])); shape.Add(new ShapeLine(sp[2], sp[3])); shape.Add(new ShapeLine(sp[3], sp[0])); dimension = new Rectangle(64, 64, 512, 256); }
public void AddLine(PointF from, PointF to) { ShapeLine line = new ShapeLine(new ShapePoint(from), new ShapePoint(to)); shape.Add(line); }