コード例 #1
0
 protected override void OnPaint(PaintEventArgs e)
 {
     if (this.gViewer != null && this.gViewer.Graph != null && this.gViewer.Graph.GeometryGraph != null)
     {
         e.Graphics.SmoothingMode     = SmoothingMode.AntiAlias;
         e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
         this.gViewer.DotOnPaint(e.Graphics, false);
     }
     base.OnPaint(e); // Filippo Polo 13/11/07; if I don't do this, onpaint events won't be invoked
     gViewer.RaisePaintEvent(e);
 }
コード例 #2
0
        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);
        }