Table of Contents

Class RasterCachedMultipageImage

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

The raster multipage image

public abstract class RasterCachedMultipageImage : RasterCachedImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasMetadata, IMultipageImage
Inheritance
RasterCachedMultipageImage
Implements
Derived
Inherited Members

Constructors

RasterCachedMultipageImage()

Initializes a new instance of the RasterCachedMultipageImage class.

protected RasterCachedMultipageImage()

RasterCachedMultipageImage(IColorPalette)

Initializes a new instance of the RasterCachedMultipageImage class.

protected RasterCachedMultipageImage(IColorPalette colorPalette)

Parameters

colorPalette IColorPalette

The color palette.

Properties

BackgroundColor

Gets or sets a value for the background color.

public override Color BackgroundColor { get; set; }

Property Value

Color

BitsPerPixel

Gets the image bits per pixel count.

public override int BitsPerPixel { get; }

Property Value

int

The image bits per pixel count.

HasAlpha

Gets a value indicating whether this instance has alpha.

public override bool HasAlpha { get; }

Property Value

bool

true if this instance has alpha; otherwise, false.

HasTransparentColor

Gets a value indicating whether image has transparent color.

public override bool HasTransparentColor { get; }

Property Value

bool

Height

Gets the image height.

public override int Height { get; }

Property Value

int

The image height.

ImageOpacity

Gets opacity of this image.

public override float ImageOpacity { get; }

Property Value

float

The opacity value between 0.0 (fully transparent) and 1.0 (fully opaque).

IsCached

Gets a value indicating whether image data is cached currently.

public override bool IsCached { get; }

Property Value

bool

true if image data is cached; otherwise, false.

PageCount

Gets the page count.

public abstract int PageCount { get; }

Property Value

int

The page count.

PageExportingAction

Gets or sets the page exporting action. Please note that setting this method will automatically release page resources after it is executed. It will be executed just before each page is saved.

public virtual PageExportingAction PageExportingAction { get; set; }

Property Value

PageExportingAction

The page exporting action.

Pages

Gets the pages.

public abstract Image[] Pages { get; }

Property Value

Image[]

The pages.

Width

Gets the image width.

public override int Width { get; }

Property Value

int

The image width.

XmpData

Gets or sets XMP data from frame.

public override XmpPacketWrapper XmpData { get; set; }

Property Value

XmpPacketWrapper

XMP packet data wrapper

Methods

AdjustBrightness(int)

Adjust of a brightness for image.

public override void AdjustBrightness(int brightness)

Parameters

brightness int

Brightness value.

AdjustContrast(float)

Image contrasting

public override void AdjustContrast(float contrast)

Parameters

contrast float

Contrast value (in range [-100; 100])

AdjustGamma(float)

Gamma-correction of an image.

public override void AdjustGamma(float gamma)

Parameters

gamma float

Gamma for red, green and blue channels coefficient

AdjustGamma(float, float, float)

Gamma-correction of an image.

public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)

Parameters

gammaRed float

Gamma for red channel coefficient

gammaGreen float

Gamma for green channel coefficient

gammaBlue float

Gamma for blue channel coefficient

BinarizeBradley(double)

Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding

public override void BinarizeBradley(double brightnessDifference)

Parameters

brightnessDifference double

The brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.

BinarizeBradley(double, int)

Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding

public override void BinarizeBradley(double brightnessDifference, int windowSize)

Parameters

brightnessDifference double

The brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.

windowSize int

The size of s x s window of pixels centered around this pixel

BinarizeFixed(byte)

Binarization of an image with predefined threshold

public override void BinarizeFixed(byte threshold)

Parameters

threshold byte

Threshold value. If corresponding gray value of a pixel is greater than threshold, a value of 255 will be assigned to it, 0 otherwise.

BinarizeOtsu()

Binarization of an image with Otsu thresholding

public override void BinarizeOtsu()

Blend(Point, RasterImage, Rectangle, byte)

Blends this image instance with the overlay image.

public override void Blend(Point origin, RasterImage overlay, Rectangle overlayArea, byte overlayAlpha = 255)

Parameters

origin Point

The background image blending origin.

overlay RasterImage

The overlay image.

overlayArea Rectangle

The overlay area.

overlayAlpha byte

The overlay alpha.

Exceptions

ImageException

Image exception

CacheData()

Caches the data private.

public override void CacheData()

CanDoAdjustments()

Determines whether this instance [can do adjustments].

protected virtual bool CanDoAdjustments()

Returns

bool

true if this instance [can do adjustments]; otherwise, false.

Crop(Rectangle)

Cropping the image.

public override void Crop(Rectangle rectangle)

Parameters

rectangle Rectangle

The rectangle.

Crop(int, int, int, int)

Crop image with shifts.

public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)

Parameters

leftShift int

The left shift.

rightShift int

The right shift.

topShift int

The top shift.

bottomShift int

The bottom shift.

Exceptions

ArgumentException

Rectangle incorrect. - rectangle or Rectangle must be contained in the image bounds. - rectangle

ImageException

Can't crop image. Frame index: " + frameIndex or Can't crop image.

CropMain(int, int, int, int)

Crops the main.

protected virtual void CropMain(int leftShift, int rightShift, int topShift, int bottomShift)

Parameters

leftShift int

The left shift.

rightShift int

The right shift.

topShift int

The top shift.

bottomShift int

The bottom shift.

Dither(DitheringMethod, int, IColorPalette)

Performs dithering on the current image.

public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)

Parameters

ditheringMethod DitheringMethod

The dithering method.

bitsCount int

The final bits count for dithering.

customPalette IColorPalette

The custom palette for dithering.

Filter(Rectangle, FilterOptionsBase)

Filters the specified rectangle.

public override void Filter(Rectangle rectangle, FilterOptionsBase options)

Parameters

rectangle Rectangle

The rectangle.

options FilterOptionsBase

The options.

GetPagesAsEnumerable()

Gets the pages as enumerable.

protected virtual IEnumerable<Image> GetPagesAsEnumerable()

Returns

IEnumerable<Image>

The own pages as enumerable.

GetSerializedStream(ImageOptionsBase, Rectangle, out int)

Converts to aps.

public override Stream GetSerializedStream(ImageOptionsBase imageOptions, Rectangle clippingRectangle, out int pageNumber)

Parameters

imageOptions ImageOptionsBase

The image options.

clippingRectangle Rectangle

The clipping rectangle.

pageNumber int

The page number.

Returns

Stream

The serialized stream

Grayscale()

Transformation of an image to its grayscale representation

public override void Grayscale()

NormalizeAngle(bool, Color)

Normalizes the angle. This method is applicable to scanned text documents to get rid of the skewed scan. This method uses GetSkewAngle() and Rotate(float, bool, Color) methods.

public override void NormalizeAngle(bool resizeProportionally, Color backgroundColor)

Parameters

resizeProportionally bool

if set to true you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated.

backgroundColor Color

Color of the background.

ReleaseManagedResources()

Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.

protected override void ReleaseManagedResources()

ReplaceColor(int, byte, int)

Replaces one color to another with allowed difference and preserves original alpha value to save smooth edges.

public override void ReplaceColor(int oldColorArgb, byte oldColorDiff, int newColorArgb)

Parameters

oldColorArgb int

Old color ARGB value to be replaced.

oldColorDiff byte

Allowed difference in old color to be able to widen replaced color tone.

newColorArgb int

New color ARGB value to replace old color with.

ReplaceNonTransparentColors(int)

Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges. Note: if you use it on images without transparency, all colors will be replaced with a single one.

public override void ReplaceNonTransparentColors(int newColorArgb)

Parameters

newColorArgb int

New color ARGB value to replace non transparent colors with.

Resize(int, int, ImageResizeSettings)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)

Parameters

newWidth int

The new width.

newHeight int

The new height.

settings ImageResizeSettings

The resize settings.

Resize(int, int, ResizeType)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

The new width.

newHeight int

The new height.

resizeType ResizeType

The resize type.

ResizeHeightProportionally(int, ResizeType)

Resizes the width proportionally.

public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)

Parameters

newHeight int

The new height.

resizeType ResizeType

Type of the resize.

ResizeMain(int, int, ResizeType)

Mains the image resize only.

protected virtual void ResizeMain(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

The new width.

newHeight int

The new height.

resizeType ResizeType

Type of the resize.

ResizeWidthProportionally(int, ResizeType)

Resizes the width proportionally.

public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)

Parameters

newWidth int

The new width.

resizeType ResizeType

Type of the resize.

Rotate(float, bool, Color)

Rotate(float, bool, Color) image around the center.

public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)

Parameters

angle float

The rotate angle in degrees. Positive values will rotate clockwise.

resizeProportionally bool

if set to true you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated.

backgroundColor Color

Color of the background.

RotateFlip(RotateFlipType)

Rotates, flips, or rotates and flips all pages.

public override void RotateFlip(RotateFlipType rotateFlipType)

Parameters

rotateFlipType RotateFlipType

The rotate flip type.

RotateFlipAll(RotateFlipType)

Rotates the flip all.

[Obsolete("Please use RotateFlip instead of this method.")]
public virtual void RotateFlipAll(RotateFlipType rotateFlip)

Parameters

rotateFlip RotateFlipType

The rotate flip.

RotateFlipMain(RotateFlipType)

Rotates the flip main.

protected virtual void RotateFlipMain(RotateFlipType rotateFlipType)

Parameters

rotateFlipType RotateFlipType

Type of the rotate flip.

SavePixelsInternalMain(Rectangle, int[])

Saves the pixels internal main.

protected virtual void SavePixelsInternalMain(Rectangle rectangle, int[] pixels)

Parameters

rectangle Rectangle

The rectangle.

pixels int[]

The pixels.