Table of Contents

Class XImage

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Defines an object used to draw image files (bmp, png, jpeg, gif) and PDF forms. An abstract base class that provides functionality for the Bitmap and Metafile descended classes.

public class XImage : IDisposable
Inheritance
XImage
Implements
Derived
Inherited Members

Constructors

XImage()

Initializes a new instance of the XImage class.

protected XImage()

Properties

Format

Gets the format of the image.

public XImageFormat Format { get; }

Property Value

XImageFormat

Height

Gets the height of the image.

[Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")]
public virtual double Height { get; }

Property Value

double

HorizontalResolution

Gets the horizontal resolution of the image.

public virtual double HorizontalResolution { get; }

Property Value

double

Interpolate

Gets or sets a flag indicating whether image interpolation is to be performed.

public virtual bool Interpolate { get; set; }

Property Value

bool

PixelHeight

Gets the height of the image in pixels.

public virtual int PixelHeight { get; }

Property Value

int

PixelWidth

Gets the width of the image in pixels.

public virtual int PixelWidth { get; }

Property Value

int

PointHeight

Gets the height of the image in point.

public virtual double PointHeight { get; }

Property Value

double

PointWidth

Gets the width of the image in point.

public virtual double PointWidth { get; }

Property Value

double

Size

Gets the size in point of the image.

public virtual XSize Size { get; }

Property Value

XSize

VerticalResolution

Gets the vertical resolution of the image.

public virtual double VerticalResolution { get; }

Property Value

double

Width

Gets the width of the image.

[Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")]
public virtual double Width { get; }

Property Value

double

Methods

Dispose()

Under construction

public void Dispose()

Dispose(bool)

Disposes underlying GDI+ object.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

ExistsFile(string)

Tests if a file exist. Supports PDF files with page number suffix.

public static bool ExistsFile(string path)

Parameters

path string

The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file.

Returns

bool

FromFile(string)

Creates an image from the specified file.

public static XImage FromFile(string path)

Parameters

path string

The path to a BMP, PNG, JPEG, or PDF file.

Returns

XImage

FromStream(Stream)

Creates an image from the specified stream.

public static XImage FromStream(Stream stream)

Parameters

stream Stream

The stream containing a BMP, PNG, JPEG, or PDF file.

Returns

XImage