Table of Contents

Class ImageDataFactory

Namespace
iText.IO.Image
Assembly
itext.io.dll
public sealed class ImageDataFactory
Inheritance
ImageDataFactory
Inherited Members

Methods

Create(byte[])

Create an ImageData instance representing the image from the image bytes.

public static ImageData Create(byte[] bytes)

Parameters

bytes byte[]

byte representation of the image.

Returns

ImageData

The created ImageData object.

Create(byte[], bool)

Create an ImageData instance representing the image from the image bytes.

public static ImageData Create(byte[] bytes, bool recoverImage)

Parameters

bytes byte[]

byte representation of the image.

recoverImage bool

whether to recover from a image error (for TIFF-images)

Returns

ImageData

The created ImageData object.

Create(int, int, bool, int, int, byte[], int[])

Create an ImageData instance from the passed parameters.

public static ImageData Create(int width, int height, bool reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency)

Parameters

width int

width of the image in pixels

height int

height of the image in pixels

reverseBits bool

whether to reverse the bits stored in data (TIFF images).

typeCCITT int

Type of CCITT encoding

parameters int

colour space parameters

data byte[]

array containing raw image data

transparency int[]

array containing transparency information

Returns

ImageData

created ImageData object.

Create(int, int, int, int, byte[], int[])

Create an ImageData instance from the passed parameters.

public static ImageData Create(int width, int height, int components, int bpc, byte[] data, int[] transparency)

Parameters

width int

width of the image in pixels

height int

height of the image in pixels

components int

colour space components

bpc int

bits per colour.

data byte[]

array containing raw image data

transparency int[]

array containing transparency information

Returns

ImageData

created ImageData object.

Create(string)

Create an ImageData instance representing the image from the specified file.

public static ImageData Create(string filename)

Parameters

filename string

filename of the file containing the image

Returns

ImageData

The created ImageData object.

Create(string, bool)

Create an ImageData instance representing the image from the specified file.

public static ImageData Create(string filename, bool recoverImage)

Parameters

filename string

filename of the file containing the image

recoverImage bool

whether to recover from a image error (for TIFF-images)

Returns

ImageData

The created ImageData object.

Create(Uri)

Create an ImageData instance representing the image from the file located at the specified url.

public static ImageData Create(Uri url)

Parameters

url Uri

location of the image

Returns

ImageData

The created ImageData object.

Create(Uri, bool)

Create an ImageData instance representing the image from the file located at the specified url.

public static ImageData Create(Uri url, bool recoverImage)

Parameters

url Uri

location of the image

recoverImage bool

whether to recover from a image error (for TIFF-images)

Returns

ImageData

The created ImageData object.

CreateBmp(byte[], bool)

Get a bitmap ImageData instance from the provided bytes.

public static ImageData CreateBmp(byte[] bytes, bool noHeader)

Parameters

bytes byte[]

array containing the raw image data

noHeader bool

Whether the image contains a header.

Returns

ImageData

created ImageData

CreateBmp(Uri, bool)

Get a bitmap ImageData instance from the specified url.

public static ImageData CreateBmp(Uri url, bool noHeader)

Parameters

url Uri

location of the image.

noHeader bool

Whether the image contains a header.

Returns

ImageData

created ImageData

CreateGif(byte[])

Return a GifImage object.

public static GifImageData CreateGif(byte[] bytes)

Parameters

bytes byte[]

array containing the raw image data

Returns

GifImageData

GifImageData instance.

Remarks

Return a GifImage object. This object cannot be added to a document

CreateGifFrame(byte[], int)

Returns a specified frame of the gif image

public static ImageData CreateGifFrame(byte[] bytes, int frame)

Parameters

bytes byte[]

byte array of gif image

frame int

number of frame to be returned, 1-based

Returns

ImageData

GifImageData instance

CreateGifFrame(Uri, int)

Returns a specified frame of the gif image

public static ImageData CreateGifFrame(Uri url, int frame)

Parameters

url Uri

url of gif image

frame int

number of frame to be returned, 1-based

Returns

ImageData

GifImageData instance.

CreateGifFrames(byte[])

Returns List of gif image frames

public static IList<ImageData> CreateGifFrames(byte[] bytes)

Parameters

bytes byte[]

byte array of gif image

Returns

IList<ImageData>

all frames of gif image

CreateGifFrames(byte[], int[])

Returns List of gif image frames

public static IList<ImageData> CreateGifFrames(byte[] bytes, int[] frameNumbers)

Parameters

bytes byte[]

byte array of gif image

frameNumbers int[]

array of frame numbers of gif image, 1-based

Returns

IList<ImageData>

all frames of gif image

CreateGifFrames(Uri)

Returns List of gif image frames

public static IList<ImageData> CreateGifFrames(Uri url)

Parameters

url Uri

url of gif image

Returns

IList<ImageData>

all frames of gif image

CreateGifFrames(Uri, int[])

Returns List of gif image frames

public static IList<ImageData> CreateGifFrames(Uri url, int[] frameNumbers)

Parameters

url Uri

url of gif image

frameNumbers int[]

array of frame numbers of gif image, 1-based

Returns

IList<ImageData>

all frames of gif image

CreateJbig2(byte[], int)

public static ImageData CreateJbig2(byte[] bytes, int page)

Parameters

bytes byte[]
page int

Returns

ImageData

CreateJbig2(Uri, int)

public static ImageData CreateJbig2(Uri url, int page)

Parameters

url Uri
page int

Returns

ImageData

CreateJpeg(byte[])

public static ImageData CreateJpeg(byte[] bytes)

Parameters

bytes byte[]

Returns

ImageData

CreateJpeg(Uri)

Create an ImageData instance from a Jpeg image url

public static ImageData CreateJpeg(Uri url)

Parameters

url Uri

URL

Returns

ImageData

the created JPEG image

CreateJpeg2000(byte[])

public static ImageData CreateJpeg2000(byte[] bytes)

Parameters

bytes byte[]

Returns

ImageData

CreateJpeg2000(Uri)

public static ImageData CreateJpeg2000(Uri url)

Parameters

url Uri

Returns

ImageData

CreatePng(byte[])

public static ImageData CreatePng(byte[] bytes)

Parameters

bytes byte[]

Returns

ImageData

CreatePng(Uri)

public static ImageData CreatePng(Uri url)

Parameters

url Uri

Returns

ImageData

CreateRawImage(byte[])

public static ImageData CreateRawImage(byte[] bytes)

Parameters

bytes byte[]

Returns

ImageData

CreateTiff(byte[], bool, int, bool)

public static ImageData CreateTiff(byte[] bytes, bool recoverFromImageError, int page, bool direct)

Parameters

bytes byte[]
recoverFromImageError bool
page int
direct bool

Returns

ImageData

CreateTiff(Uri, bool, int, bool)

public static ImageData CreateTiff(Uri url, bool recoverFromImageError, int page, bool direct)

Parameters

url Uri
recoverFromImageError bool
page int
direct bool

Returns

ImageData

IsSupportedType(byte[])

Checks if the type of image (based on first 8 bytes) is supported by factory.

public static bool IsSupportedType(byte[] source)

Parameters

source byte[]

image raw bytes

Returns

bool

true if first eight bytes are recognised by factory as valid image type and false otherwise

Remarks

Checks if the type of image (based on first 8 bytes) is supported by factory.
Note: if this method returns true it doesn't means that Create(byte[]) won't throw exception

IsSupportedType(Uri)

Checks if the type of image (based on first 8 bytes) is supported by factory.

public static bool IsSupportedType(Uri source)

Parameters

source Uri

image URL

Returns

bool

true if first eight bytes are recognised by factory as valid image type and false otherwise

Remarks

Checks if the type of image (based on first 8 bytes) is supported by factory.
Note: if this method returns true it doesn't means that Create(byte[]) won't throw exception

IsSupportedType(ImageType)

Checks if the type of image is supported by factory.

public static bool IsSupportedType(ImageType imageType)

Parameters

imageType ImageType

image type

Returns

bool

true if image type is supported and false otherwise

Remarks

Checks if the type of image is supported by factory.
Note: if this method returns true it doesn't means that Create(byte[]) won't throw exception