[]
Initializes an empty instance of the GcBitmap class.
public GcBitmap()
Public Sub New()
Initializes a new instance of the GcBitmap class and creates the image.
The image content is not initialized and can contain any random data.
If subsequent rendering is going to cover the whole surface of the bitmap, or if CreateGraphics(Color?) will be called on the bitmap with a non-null background color, clearing it (which is a lengthy operation for large bitmaps) is not needed. If some areas of the bitmap are going to be left untouched, they must be cleared to avoid the possibility of random artifacts showing.
public GcBitmap(int pixelWidth, int pixelHeight, bool opaque, float dpiX = 96, float dpiY = 96, bool storeInTempFile = false)
Public Sub New(pixelWidth As Integer, pixelHeight As Integer, opaque As Boolean, Optional dpiX As Single = 96, Optional dpiY As Single = 96, Optional storeInTempFile As Boolean = False)
Type | Name | Description |
---|---|---|
int | pixelWidth | The width of the image, in pixels. |
int | pixelHeight | The height of the image, in pixels. |
bool | opaque | Indicates whether the alpha channel should be ignored. |
float | dpiX | The horizontal dpi of the image. |
float | dpiY | The vertical dpi of the image. |
bool | storeInTempFile | Indicates whether pixel data should be dynamically mapped to a temporary file rather than kept fully in memory. |
Initializes a new instance of the GcBitmap class and sets the existing pixel data to be read/modified in-place.
public GcBitmap(uint[] pixelData, int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, float dpiX = 96, float dpiY = 96)
Public Sub New(pixelData As UInteger(), pixelWidth As Integer, pixelHeight As Integer, opaque As Boolean, Optional premultiplied As Boolean = False, Optional dpiX As Single = 96, Optional dpiY As Single = 96)
Type | Name | Description |
---|---|---|
uint[] | pixelData | The pixel data to be attached to a GcBitmap. |
int | pixelWidth | The width of the image, in pixels. |
int | pixelHeight | The height of the image, in pixels. |
bool | opaque | Indicates whether the alpha channel should be ignored. |
bool | premultiplied | Indicates whether the color channels are premultiplied by the alpha channel. |
float | dpiX | The horizontal dpi of the image. |
float | dpiY | The vertical dpi of the image. |
Initializes a new instance of the GcBitmap class and sets the existing pixel data to be read/modified in-place.
public GcBitmap(IntPtr pixelData, int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, float dpiX = 96, float dpiY = 96)
Public Sub New(pixelData As IntPtr, pixelWidth As Integer, pixelHeight As Integer, opaque As Boolean, Optional premultiplied As Boolean = False, Optional dpiX As Single = 96, Optional dpiY As Single = 96)
Type | Name | Description |
---|---|---|
IntPtr | pixelData | The pixel data to be attached to a GcBitmap. |
int | pixelWidth | The width of the image, in pixels. |
int | pixelHeight | The height of the image, in pixels. |
bool | opaque | Indicates whether the alpha channel should be ignored. |
bool | premultiplied | Indicates if the color channels are premultiplied by the alpha channel. |
float | dpiX | The horizontal dpi of the image. |
float | dpiY | The vertical dpi of the image. |
Initializes a new instance of the GcBitmap class.
public GcBitmap(Stream stream, int frameIndex = 0, Rectangle? imageRect = null, bool storeInTempFile = false)
Public Sub New(stream As Stream, Optional frameIndex As Integer = 0, Optional imageRect As Rectangle? = Nothing, Optional storeInTempFile As Boolean = False)
Type | Name | Description |
---|---|---|
Stream | stream | The source stream. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
int | frameIndex | Index of an image frame to read, pass 0 for image formats not supporting multiple frames. |
Rectangle? | imageRect | Clipping rectangle of the image to be loaded. |
bool | storeInTempFile | Indicates whether pixel data should be dynamically mapped to a temporary file rather than kept fully in memory. |
Initializes a new instance of the GcBitmap class.
public GcBitmap(string path, int frameIndex = 0, Rectangle? imageRect = null, bool storeInTempFile = false)
Public Sub New(path As String, Optional frameIndex As Integer = 0, Optional imageRect As Rectangle? = Nothing, Optional storeInTempFile As Boolean = False)
Type | Name | Description |
---|---|---|
string | path | The file path to the image. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
int | frameIndex | Index of an image frame to read, pass 0 for image formats not supporting multiple frames. |
Rectangle? | imageRect | Clipping rectangle of the image to be loaded. |
bool | storeInTempFile | Indicates whether pixel data should be dynamically mapped to a temporary file rather than kept fully in memory. |
Initializes a new instance of the GcBitmap class.
public GcBitmap(byte[] bytes, int frameIndex = 0, Rectangle? imageRect = null, bool storeInTempFile = false)
Public Sub New(bytes As Byte(), Optional frameIndex As Integer = 0, Optional imageRect As Rectangle? = Nothing, Optional storeInTempFile As Boolean = False)
Type | Name | Description |
---|---|---|
byte[] | bytes | The image data. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
int | frameIndex | Index of an image frame to read, pass 0 for image formats not supporting multiple frames. |
Rectangle? | imageRect | Clipping rectangle of the image to be loaded. |
bool | storeInTempFile | Indicates whether pixel data should be dynamically mapped to a temporary file rather than kept fully in memory. |
Initializes a new instance of the GcBitmap class.
public GcBitmap(Image image, Rectangle? imageRect = null, bool storeInTempFile = false)
Public Sub New(image As Image, Optional imageRect As Rectangle? = Nothing, Optional storeInTempFile As Boolean = False)