public void DrawClippingWindow(IClippingWindow window, System.Drawing.Graphics g) { RectangularClippingWindow rectWindow = window as RectangularClippingWindow; if (rectWindow != null) { g.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Blue, 1), rectWindow.TopLeft.X, rectWindow.TopLeft.Y, rectWindow.TopRight.X - rectWindow.TopLeft.X, rectWindow.BottomLeft.Y - rectWindow.TopLeft.Y); } }
public void ShowPoints(List <Point> points, IClippingWindow window) { _bitmap = new System.Drawing.Bitmap(pictureBox.Size.Width, pictureBox.Size.Height); using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(_bitmap)) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; for (int i = 0; i < points.Count; i++) { g.FillEllipse(System.Drawing.Brushes.Black, points[i].X - 5 / 2, points[i].Y - 5 / 2, 5, 5); if (i > 0) { g.DrawLine(new System.Drawing.Pen(System.Drawing.Brushes.Black, 1), points[i - 1].X, points[i - 1].Y, points[i].X, points[i].Y); } } DrawClippingWindow(window, g); } pictureBox.Refresh(); }
public void SetClippingWindow(decimal topLeftX, decimal topLeftY, decimal width, decimal height) { Point topLeft = new Point(Convert.ToInt32(topLeftX), Convert.ToInt32(topLeftY)); _clippingWindow = new RectangularClippingWindow(topLeft, Convert.ToInt32(width), Convert.ToInt32(height)); }
public void SetClippingWindow(int topLeftX, int topLeftY, int width, int height) { Point topLeft = new Point(topLeftX, topLeftY); _clippingWindow = new RectangularClippingWindow(topLeft, width, height); }