protected override void OnPaint(PaintEventArgs e) { if (gViewer != null && gViewer.Graph != null && gViewer.Graph.GeometryGraph != null) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias; gViewer.ProcessOnPaint(e.Graphics, null); } if (CurrentRubberEdge != null) { using (GraphicsPath gp = Draw.CreateGraphicsPath(CurrentRubberEdge.Curve)) using (var pen = new Pen(Brushes.Black, (float)GViewer.LineThicknessForEditing)) e.Graphics.DrawPath(pen, gp); } if (DrawingRubberEdge) { e.Graphics.DrawLine(new Pen(Brushes.Black, (float)GViewer.LineThicknessForEditing), (float)rubberLineStart.X, (float)rubberLineStart.Y, (float)RubberLineEnd.X, (float)RubberLineEnd.Y); } base.OnPaint(e); // Filippo Polo 13/11/07; if I don't do this, onpaint events won't be invoked gViewer.RaisePaintEvent(e); }
/// <summary> /// This methods "draws" to the printer /// </summary> /// <param name="e"></param> protected override void OnPrintPage(PrintPageEventArgs e) { base.OnPrintPage(e); gViewer.ProcessOnPaint(e.Graphics, e); }