Ejemplo n.º 1
0
        public static void Render(this IView2D view, Graphics g)
        {
            GDIPlusRenderer r = new GDIPlusRenderer(g);

            view.Render(r);
            r.Close();
        }
Ejemplo n.º 2
0
 private void picMain_Paint(object sender, PaintEventArgs e)
 {
     if (view != null)
     {
         try
         {
             GDIPlusRenderer r = new GDIPlusRenderer(e.Graphics);
             r.Clear(this.BackColor);
             view.Render(r);
             if (view is IEditableView2D)
             {
                 IEditableView2D ev = view as IEditableView2D;
                 ev.RenderGizmoLayer(r);
             }
             r.Close();
         }
         catch (Exception ex)
         {
             e.Graphics.DrawString(ex.GetADecentExplination(), this.Font, Brushes.Red, 20, 20);
             e.Graphics.DrawString(ex.StackTrace.ToString().Wrap(40), this.Font, Brushes.Red, 20, 50);
             WDAppLog.logException(ErrorLevel.Error, ex);
         }
     }
 }