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
widthintSpecifies the width of the image.
heightintSpecifies the height of the image.
clearboolIf 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
urlstringPath or url to file with image data.
bitmapTypeBitmapTypeType 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.
indexintIndex 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
urlstringPath or url to file with image data.
mimeTypestringMIME type string (for example 'image/jpeg').
indexintSee 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
streamStreamOpened input stream from which to load the image. Currently, the stream must support seeking.
bitmapTypeBitmapTypeSee description in GenericImage(string?, BitmapType, int).
indexintSee 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
streamStreamOpened input stream from which to load the image. Currently, the stream must support seeking.
mimeTypestringMIME type string (for example 'image/jpeg').
indexintSee 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
widthintSpecifies the width of the image.
heightintSpecifies the height of the image.
dataSKColor[]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
widthintSpecifies the width of the image.
heightintSpecifies the height of the image.
dataRGBValue[]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
widthintSpecifies the width of the image.
heightintSpecifies the height of the image.
dataRGBValue[]RGB data.
alphabyte[]Alpha-channel data.
GenericImage(IGenericImageHandler)
Initializes a new instance of the GenericImage class.
public GenericImage(IGenericImageHandler handle)
Parameters
handleIGenericImageHandler