Constructor GenericImage
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
intSpecifies the width of the image.
height
intSpecifies the height of the image.
clear
boolIf 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
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
stringPath or url to file with image data.
bitmapType
BitmapTypeType 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
intIndex 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
stringPath or url to file with image data.
mimetype
stringMIME type string (for example 'image/jpeg').
index
intSee 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
StreamOpened input stream from which to load the image. Currently, the stream must support seeking.
bitmapType
BitmapTypeSee description in GenericImage(string?, BitmapType, int).
index
intSee 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
StreamOpened input stream from which to load the image. Currently, the stream must support seeking.
mimeType
stringMIME type string (for example 'image/jpeg').
index
intSee 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
intSpecifies the width of the image.
height
intSpecifies 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
intSpecifies the width of the image.
height
intSpecifies 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
intSpecifies the width of the image.
height
intSpecifies 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