Beispiel #1
0
 /// <summary>
 /// Captures a part of the view contents to a bitmap allowing for visibility of grid and axes.
 /// </summary>
 /// <param name="size">The width and height of the returned bitmap.</param>
 /// <param name="grid">true if the construction plane grid should be visible.</param>
 /// <param name="worldAxes">true if the world axis should be visible.</param>
 /// <param name="cplaneAxes">true if the construction plane close the grid should be visible.</param>
 /// <returns>A new bitmap.</returns>
 /// <since>5.0</since>
 public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size, bool grid, bool worldAxes, bool cplaneAxes)
 {
     using (var dib = new Runtime.InteropWrappers.RhinoDib())
     {
         var dib_pointer = dib.NonConstPointer;
         if (UnsafeNativeMethods.CRhinoView_CaptureToBitmap2(m_runtime_serial_number, dib_pointer, size.Width, size.Height, grid, worldAxes, cplaneAxes))
         {
             var bitmap = dib.ToBitmap();
             return(bitmap);
         }
     }
     return(null);
 }
Beispiel #2
0
 /// <summary>
 /// Capture View contents to a bitmap.
 /// </summary>
 /// <param name="size">Size of Bitmap to capture to.</param>
 /// <returns>The bitmap of the specified part of the view.</returns>
 /// <since>5.0</since>
 public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size)
 {
     using (var dib = new Runtime.InteropWrappers.RhinoDib())
     {
         var dib_pointer = dib.NonConstPointer;
         if (UnsafeNativeMethods.CRhinoView_CaptureToBitmap(m_runtime_serial_number, dib_pointer, size.Width, size.Height, IntPtr.Zero))
         {
             var bitmap = dib.ToBitmap();
             return(bitmap);
         }
     }
     return(null);
 }
Beispiel #3
0
        /// <summary>
        /// Capture View contents to a bitmap using display attributes to define how
        /// drawing is performed.
        /// </summary>
        /// <param name="size">The width and height of the returned bitmap.</param>
        /// <param name="attributes">The specific display mode attributes.</param>
        /// <returns>A new bitmap.</returns>
        /// <since>5.0</since>
        public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size, DisplayPipelineAttributes attributes)
        {
            IntPtr const_ptr_attributes = attributes.ConstPointer();

            using (var dib = new Runtime.InteropWrappers.RhinoDib())
            {
                var dib_pointer = dib.NonConstPointer;
                if (UnsafeNativeMethods.CRhinoView_CaptureToBitmap(m_runtime_serial_number, dib_pointer, size.Width, size.Height, const_ptr_attributes))
                {
                    var bitmap = dib.ToBitmap();
                    return(bitmap);
                }
            }
            return(null);
        }