void WriteRectL(double x, double y, double width, double height) { Emf.RectL r = new Emf.RectL(); r.Left = (int)x; r.Top = (int)y; r.Right = (int)(x + width); r.Bottom = (int)(y + height); WriteRectL(r); }
Emf.RectL CalcBounds(DPoints pts) { Emf.RectL r = new Emf.RectL(0, 0, 0, 0); if (pts.Count > 0) { r.Left = (int)pts[0].X; r.Top = (int)pts[0].Y; r.Right = (int)pts[0].X; r.Bottom = (int)pts[0].Y; } foreach (DPoint pt in pts) { if (pt.X < r.Left) r.Left = (int)pt.X; if (pt.Y < r.Top) r.Top = (int)pt.Y; if (pt.X > r.Right) r.Right = (int)pt.X; if (pt.Y > r.Bottom) r.Bottom = (int)pt.Y; } return r; }