[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Graphics.Images.PdfImageBase

Class PdfImageBase

Namespace
GrapeCity.Documents.Pdf.Graphics.Images
Assembly
GcDocs.Pdf.dll

Base abstract class for classes describing images in a PDF file, including inline PDF images defined in the PDF content stream using BI and EI operators.

public abstract class PdfImageBase : PdfDictWrapper, IPdfDict, IPdfImage, IImage, IDisposable
Inheritance
object
PdfImageBase
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Properties

BitsPerPixel

Gets the number of bits-per-pixel (BPP) for this image.

public abstract int BitsPerPixel { get; }

Property Value

int

Height

Gets the height of the image in pixels.

public abstract int Height { get; }

Property Value

int

HorizontalResolution

Gets the horizontal resolution of the image. If this property returns a value that is less or equal than 0, then the horizontal resolution is not specified for an image.

public abstract float HorizontalResolution { get; }

Property Value

float

ImageMask

Gets a value indicating whether the image is defined as a stencil mask for painting in the current color.

public virtual bool ImageMask { get; }

Property Value

bool

InlineImage

Gets a value indicating whether the image is an inline image defined directly in a PDF content stream.

public virtual bool InlineImage { get; }

Property Value

bool

VerticalResolution

Gets the vertical resolution of the image. If this property returns a value that is less or equal than 0, then the vertical resolution is not specified for an image.

public abstract float VerticalResolution { get; }

Property Value

float

Width

Gets the width of the image in pixels.

public abstract int Width { get; }

Property Value

int

Methods

GetCacheKey()

For internal use. Returns a key uniquely identifying the object in its GcPdfDocument, can return null if object can not be uniquely identified.

public virtual object GetCacheKey()

Returns

object

The key uniquely identifying the object.

GetImageStreamInfo()

Returns the GrapeCity.Documents.Pdf.Spec.PdfStreamObject containing unparsed image data and information about the PDF filter and decode parameters.

Note that not all derived classes support this method (for example, PdfImageHandler).

public abstract PdfStreamInfo GetImageStreamInfo()

Returns

PdfStreamInfo

GetNativeImage(Color, Color)

Creates and returns a GcBitmap object representing the current PdfImageBase object.

IMPORTANT NOTE: the returned bitmap must be disposed after use.

An image in a PDF can be specified as an "image mask" (see ImageMask), in which case the image data is used as a stencil mask for painting in the current color specified by currentUnmaskedColor, maskedColor specifies the color of the area excluded from filling (it is transparent in most cases).

public GcBitmap GetNativeImage(Color currentUnmaskedColor, Color maskedColor)

Parameters

currentUnmaskedColor System.Drawing.Color

The current color used to fill the unmasked area.

maskedColor System.Drawing.Color

The color of the area that is excluded from filling (typically transparent).

Returns

GcBitmap

The created GcBitmap object (must be disposed after use!).

ToGcBitmap(out bool)

Retrieves the underlying GcBitmap object, or creates a new GcBitmap that contains the image data.

Note that you should dispose the returned GcBitmap if disposeAfterUse is true.

public GcBitmap ToGcBitmap(out bool disposeAfterUse)

Parameters

disposeAfterUse bool

OUT: Indicates whether the returned GcBitmap should be disposed by the user.

Returns

GcBitmap

A GcBitmap object containing the image.