/// <summary>
 /// Draw a given viewport to an off-screen bitmap.
 /// </summary>
 /// <param name="viewport">Viewport to draw.</param>
 /// <param name="width">Width of target image.</param>
 /// <param name="height">Height of target image.</param>
 /// <returns>A bitmap containing the given view, or null on error.</returns>
 public static System.Drawing.Bitmap DrawToBitmap(RhinoViewport viewport, int width, int height)
 {
   if (null == viewport)
     return null;
   IntPtr pViewport = viewport.ConstPointer();
   IntPtr hBitmap = UnsafeNativeMethods.CRhinoDisplayPipeline_DrawToBitmap(pViewport, width, height);
   if (IntPtr.Zero == hBitmap)
     return null;
   return System.Drawing.Image.FromHbitmap(hBitmap);
 }
Esempio n. 2
0
 public RhinoViewport(RhinoViewport other)
 {
   IntPtr pOther = other.ConstPointer();
   m_ptr = UnsafeNativeMethods.CRhinoViewport_New(pOther);
   m_bDeletePtr = true;
 }
 IntPtr m_ptr; //CRhinoZBuffer*
 public ZBufferCapture(RhinoViewport viewport)
 {
   IntPtr pViewport = IntPtr.Zero;
   if( viewport!=null )
     pViewport = viewport.ConstPointer();
   m_ptr = UnsafeNativeMethods.CRhinoZBuffer_New(pViewport);
 }