public static Bitmap RenderAsBitmap(this GraphDocument document, EmbeddedObjectRenderingOptions renderingOptions, PixelFormat pixelFormat = PixelFormat.Format32bppArgb) { BrushX opaqueGround = null; if (!GraphExportOptions.HasPixelFormatAlphaChannel(pixelFormat)) opaqueGround = new BrushX(renderingOptions.BackgroundColorForFormatsWithoutAlphaChannel); return RenderAsBitmap(document, opaqueGround, renderingOptions.BackgroundBrush, pixelFormat, renderingOptions.SourceDpiResolution, renderingOptions.SourceDpiResolution * renderingOptions.OutputScalingFactor); }
public EmbeddedObjectRenderingOptions(EmbeddedObjectRenderingOptions from) { if (null == from) { throw new ArgumentNullException(); } CopyFrom(from); }
/// <summary> /// Renders the graph document as bitmap with default PixelFormat.Format32bppArgb. /// </summary> /// <param name="doc">The graph document used.</param> /// <param name="exportOptions">The clipboard export options.</param> /// <param name="pixelFormat">The pixel format for the bitmap. Default is PixelFormat.Format32bppArgb.</param> /// <returns>The rendered enhanced metafile.</returns> public static Bitmap RenderAsBitmap(GraphDocument doc, EmbeddedObjectRenderingOptions exportOptions, PixelFormat pixelFormat = PixelFormat.Format32bppArgb) { BrushX opaqueGround = null; if (!GraphExportOptions.HasPixelFormatAlphaChannel(pixelFormat)) { opaqueGround = new BrushX(exportOptions.BackgroundColorForFormatsWithoutAlphaChannel); } var result = RenderAsBitmap(doc, opaqueGround, exportOptions.BackgroundBrush, pixelFormat, exportOptions.SourceDpiResolution, exportOptions.SourceDpiResolution / exportOptions.OutputScalingFactor); if (null != opaqueGround) { opaqueGround.Dispose(); } return(result); }
/// <summary> /// Renders the graph document as enhanced metafile image in vector format with the options given in <paramref name="exportOptions"/> /// </summary> /// <param name="doc">The graph document used.</param> /// <param name="exportOptions">The clipboard export options.</param> /// <param name="stream">Optional: if given, the metafile is additionally rendered into the stream.</param> /// <returns>The rendered enhanced metafile.</returns> public static Metafile RenderAsEnhancedMetafileVectorFormat(GraphDocument doc, EmbeddedObjectRenderingOptions exportOptions, System.IO.Stream stream = null) { return(RenderAsEnhancedMetafileVectorFormat(doc, exportOptions.SourceDpiResolution, exportOptions.OutputScalingFactor, exportOptions.BackgroundBrush, PixelFormat.Format32bppArgb, stream)); }
/// <summary> /// Renders the graph document as enhanced metafile image in vector format with the options given in <paramref name="exportOptions"/> /// </summary> /// <param name="doc">The graph document used.</param> /// <param name="exportOptions">The clipboard export options.</param> /// <param name="stream">Optional: if given, the metafile is additionally rendered into the stream.</param> /// <returns>The rendered enhanced metafile.</returns> public static Metafile RenderAsEnhancedMetafileVectorFormat(GraphDocument doc, EmbeddedObjectRenderingOptions exportOptions, System.IO.Stream stream = null) { return RenderAsEnhancedMetafileVectorFormat(doc, exportOptions.SourceDpiResolution, exportOptions.OutputScalingFactor, exportOptions.BackgroundBrush, PixelFormat.Format32bppArgb, stream); }
/// <summary> /// Renders the graph document as bitmap with default PixelFormat.Format32bppArgb. /// </summary> /// <param name="doc">The graph document used.</param> /// <param name="exportOptions">The clipboard export options.</param> /// <param name="pixelFormat">The pixel format for the bitmap. Default is PixelFormat.Format32bppArgb.</param> /// <returns>The rendered enhanced metafile.</returns> public static Bitmap RenderAsBitmap(GraphDocument doc, EmbeddedObjectRenderingOptions exportOptions, PixelFormat pixelFormat = PixelFormat.Format32bppArgb) { BrushX opaqueGround = null; if (!GraphExportOptions.HasPixelFormatAlphaChannel(pixelFormat)) opaqueGround = new BrushX(exportOptions.BackgroundColorForFormatsWithoutAlphaChannel); var result = RenderAsBitmap(doc, opaqueGround, exportOptions.BackgroundBrush, pixelFormat, exportOptions.SourceDpiResolution, exportOptions.SourceDpiResolution / exportOptions.OutputScalingFactor); if (null != opaqueGround) opaqueGround.Dispose(); return result; }
public EmbeddedObjectRenderingOptions(EmbeddedObjectRenderingOptions from) { if (null == from) throw new ArgumentNullException(); CopyFrom(from); }