Table of Contents

Constructor GenericImage

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

GenericImage()

Initializes a new instance of the GenericImage class. Creates an empty image without an alpha channel.

public GenericImage()

GenericImage(int, int, bool)

Initializes a new instance of the GenericImage class. Creates an image with the given size and clears it if requested. Does not create an alpha channel.

public GenericImage(int width, int height, bool clear = false)

Parameters

width int

Specifies the width of the image.

height int

Specifies the height of the image.

clear bool

If true, initialize the image to black.

GenericImage(SizeI, bool)

Initializes a new instance of the GenericImage class. Creates an image with the given size and clears it if requested. Does not create an alpha channel.

public GenericImage(SizeI size, bool clear = false)

Parameters

size SizeI

Specifies the size of the image.

clear bool

If true, initialize the image to black.

GenericImage(string?, BitmapType, int)

Initializes a new instance of the GenericImage class. Creates an image from a file.

public GenericImage(string? url, BitmapType bitmapType = BitmapType.Any, int index = -1)

Parameters

url string

Path or url to file with image data.

bitmapType BitmapType

Type of the bitmap. Depending on how library and OS has been configured and by which handlers have been loaded, not all formats may be available. If value is Any, function will try to autodetect the format.

index int

Index of the image to load in the case that the image file contains multiple images. This is only used by GIF, ICO and TIFF handlers.The default value(-1) means "choose the default image" and is interpreted as the first image(index= 0) by the GIF and TIFF handler and as the largest and most colorful one by the ICO handler.

GenericImage(string?, string, int)

Initializes a new instance of the GenericImage class. Creates an image from a file using MIME-types to specify the type.

public GenericImage(string? url, string mimetype, int index = -1)

Parameters

url string

Path or url to file with image data.

mimetype string

MIME type string (for example 'image/jpeg').

index int

See description in GenericImage(string?, BitmapType, int)

GenericImage(Stream, BitmapType, int)

Initializes a new instance of the GenericImage class. Creates an image from a stream.

public GenericImage(Stream stream, BitmapType bitmapType = BitmapType.Any, int index = -1)

Parameters

stream Stream

Opened input stream from which to load the image. Currently, the stream must support seeking.

bitmapType BitmapType

See description in GenericImage(string?, BitmapType, int).

index int

See description in GenericImage(string?, BitmapType, int).

GenericImage(Stream, string, int)

Initializes a new instance of the GenericImage class. Creates an image from a stream.

public GenericImage(Stream stream, string mimeType, int index = -1)

Parameters

stream Stream

Opened input stream from which to load the image. Currently, the stream must support seeking.

mimeType string

MIME type string (for example 'image/jpeg').

index int

See description in GenericImage(string?, BitmapType, int)

GenericImage(int, int, SKColor[])

Initializes a new instance of the GenericImage class. Creates an image from data in memory.

public GenericImage(int width, int height, SKColor[] data)

Parameters

width int

Specifies the width of the image.

height int

Specifies the height of the image.

data SKColor[]

Image data.

GenericImage(int, int, RGBValue[])

Initializes a new instance of the GenericImage class. Creates an image from data in memory.

public GenericImage(int width, int height, RGBValue[] data)

Parameters

width int

Specifies the width of the image.

height int

Specifies the height of the image.

data RGBValue[]

RGB data.

GenericImage(int, int, RGBValue[], byte[])

Initializes a new instance of the GenericImage class. Creates an image from data in memory.

public GenericImage(int width, int height, RGBValue[] data, byte[] alpha)

Parameters

width int

Specifies the width of the image.

height int

Specifies the height of the image.

data RGBValue[]

RGB data.

alpha byte[]

Alpha-channel data.

GenericImage(IGenericImageHandler)

Initializes a new instance of the GenericImage class.

public GenericImage(IGenericImageHandler handle)

Parameters

handle IGenericImageHandler