PDFsharp-net6

XImage

Namespace: PdfSharp.Drawing

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 : System.IDisposable

Inheritance ObjectXImage
Implements IDisposable

Properties

Width

Caution

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.


Gets the width of the image.

public double Width { get; }

Property Value

Double

Height

Caution

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.


Gets the height of the image.

public double Height { get; }

Property Value

Double

PointWidth

Gets the width of the image in point.

public double PointWidth { get; }

Property Value

Double

PointHeight

Gets the height of the image in point.

public double PointHeight { get; }

Property Value

Double

PixelWidth

Gets the width of the image in pixels.

public int PixelWidth { get; }

Property Value

Int32

PixelHeight

Gets the height of the image in pixels.

public int PixelHeight { get; }

Property Value

Int32

Size

Gets the size in point of the image.

public XSize Size { get; }

Property Value

XSize

HorizontalResolution

Gets the horizontal resolution of the image.

public double HorizontalResolution { get; }

Property Value

Double

VerticalResolution

Gets the vertical resolution of the image.

public double VerticalResolution { get; }

Property Value

Double

Interpolate

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

public bool Interpolate { get; set; }

Property Value

Boolean

Format

Gets the format of the image.

public XImageFormat Format { get; }

Property Value

XImageFormat

Methods

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

FromImportedImage(ImportedImage)

Caution

THHO4THHO Internal test code.


Creates an image.

internal static XImage FromImportedImage(ImportedImage image)

Parameters

image ImportedImage
The imported image.

Returns

XImage

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

Boolean

Initialize()

internal void Initialize()

Dispose()

Under construction

public void Dispose()

Dispose(Boolean)

Disposes underlying GDI+ object.

protected void Dispose(bool disposing)

Parameters

disposing Boolean

AssociateWithGraphics(XGraphics)

internal void AssociateWithGraphics(XGraphics gfx)

Parameters

gfx XGraphics

DisassociateWithGraphics()

internal void DisassociateWithGraphics()

DisassociateWithGraphics(XGraphics)

internal void DisassociateWithGraphics(XGraphics gfx)

Parameters

gfx XGraphics