• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class SvgImage

A vector image backed by a VectorScene, loadable from and savable to SVG, EMF, WMF, and raster formats. Mirrors Metafile.

Inheritance
object
Image
SvgImage
Implements
IDisposable
Inherited Members
Image.Size
Image.PhysicalDimension
Image.HorizontalResolution
Image.VerticalResolution
Image.GetBounds(ref GraphicsUnit)
Image.GetFrameCount(FrameDimension)
Image.SelectActiveFrame(FrameDimension, int)
Image.GetPropertyItem(int)
Image.GetPropertyIdList()
Image.PropertyItems
Image.GetEncoderParameterList(Guid)
Image.GetThumbnailImage(int, int, GetThumbnailImageAbort, IntPtr)
Image.FromFile(string)
Image.FromStream(Stream)
Image.Dispose()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DRIT.Drawing.Imaging
Assembly: DRIT.Drawing.dll
Syntax
public sealed class SvgImage : Image, IDisposable

Constructors

SvgImage(Stream)

Initializes a new SvgImage by loading an SVG document from the specified stream.

Declaration
public SvgImage(Stream stream)
Parameters
Type Name Description
Stream stream

The stream to load from.

SvgImage(int, int)

Initializes a new empty SvgImage with the specified dimensions.

Declaration
public SvgImage(int width, int height)
Parameters
Type Name Description
int width

The canvas width in pixels.

int height

The canvas height in pixels.

SvgImage(int, int, float, float)

Initializes a new empty SvgImage with the specified dimensions and resolution.

Declaration
public SvgImage(int width, int height, float dpiX, float dpiY)
Parameters
Type Name Description
int width

The canvas width in pixels.

int height

The canvas height in pixels.

float dpiX

The horizontal resolution in dots per inch.

float dpiY

The vertical resolution in dots per inch.

SvgImage(string)

Initializes a new SvgImage by loading an SVG document from the specified file.

Declaration
public SvgImage(string filename)
Parameters
Type Name Description
string filename

The SVG file to load.

Properties

EmfOutputMode

Gets or sets the EMF output mode used when saving this image as EMF. The Excel-compatible coordinate option always enables dual mode.

Declaration
public EmfOutputMode EmfOutputMode { get; set; }
Property Value
Type Description
EmfOutputMode

Flags

Gets the flags for this image.

Declaration
public override int Flags { get; }
Property Value
Type Description
int
Overrides
Image.Flags

Height

Gets the height of this image in pixels.

Declaration
public override int Height { get; }
Property Value
Type Description
int
Overrides
Image.Height

PixelFormat

Gets the pixel format of this image.

Declaration
public override PixelFormat PixelFormat { get; }
Property Value
Type Description
PixelFormat
Overrides
Image.PixelFormat

RawFormat

Gets the format of this image.

Declaration
public override ImageFormat RawFormat { get; }
Property Value
Type Description
ImageFormat
Overrides
Image.RawFormat

UseClassicEmfOutput

Gets or sets whether EMF output omits EMF+ comments and uses only the classic EMF fallback records.

Declaration
public bool UseClassicEmfOutput { get; set; }
Property Value
Type Description
bool

UseExcelCompatibleEmfCoordinates

Gets or sets whether EMF output uses Excel-compatible logical path coordinates: path points are written at sixteen times their effective coordinates and bracketed by a 1/16 world transform.

Declaration
public bool UseExcelCompatibleEmfCoordinates { get; set; }
Property Value
Type Description
bool

Width

Gets the width of this image in pixels.

Declaration
public override int Width { get; }
Property Value
Type Description
int
Overrides
Image.Width

Methods

Clone()

Creates an exact copy of this image.

Declaration
public override Image Clone()
Returns
Type Description
Image

A new Image with the same content.

Overrides
Image.Clone()

CreateGraphics()

Creates a Graphics surface for drawing onto this SVG image. Drawing operations are recorded as vector commands; no rasterization occurs until RenderToBitmap is called.

Declaration
public Graphics CreateGraphics()
Returns
Type Description
Graphics

A Graphics backed by a RecordingGraphics.

RenderToBitmap()

Renders this SVG image to a Bitmap by replaying the recorded commands onto a raster Graphics surface.

Declaration
public Bitmap RenderToBitmap()
Returns
Type Description
Bitmap

The rendered bitmap.

RenderToBitmap(int, int)

Renders this SVG image to a Bitmap of the specified size by replaying the recorded commands onto a scaled raster surface.

Declaration
public Bitmap RenderToBitmap(int width, int height)
Parameters
Type Name Description
int width

The output bitmap width.

int height

The output bitmap height.

Returns
Type Description
Bitmap

The rendered bitmap.

RotateFlip(RotateFlipType)

Rotates and flips the image.

Declaration
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
Type Name Description
RotateFlipType rotateFlipType

The rotation and flip type.

Overrides
Image.RotateFlip(RotateFlipType)

Save(Stream, ImageFormat)

Saves this image to the specified stream in the specified format.

Declaration
public override void Save(Stream stream, ImageFormat format)
Parameters
Type Name Description
Stream stream

The stream to save to.

ImageFormat format

The format to save in.

Overrides
Image.Save(Stream, ImageFormat)

Save(Stream, ImageFormat, EncoderParameters?)

Saves this image to the specified stream in the specified format with encoder parameters.

Declaration
public override void Save(Stream stream, ImageFormat format, EncoderParameters? encoderParams)
Parameters
Type Name Description
Stream stream

The stream to save to.

ImageFormat format

The format to save in.

EncoderParameters encoderParams

The encoder parameters.

Overrides
Image.Save(Stream, ImageFormat, EncoderParameters?)

Save(string)

Saves this image to the specified file.

Declaration
public override void Save(string filename)
Parameters
Type Name Description
string filename

The file name to save to.

Overrides
Image.Save(string)

Save(string, ImageFormat)

Saves this image to the specified file in the specified format.

Declaration
public override void Save(string filename, ImageFormat format)
Parameters
Type Name Description
string filename

The file name to save to.

ImageFormat format

The format to save in.

Overrides
Image.Save(string, ImageFormat)

Implements

IDisposable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX