[]
Creates the image of the given size and resolution.
The 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 void CreateImage(int pixelWidth, int pixelHeight, bool opaque, float dpiX = 96, float dpiY = 96)
Public Sub CreateImage(pixelWidth As Integer, pixelHeight As Integer, opaque As Boolean, Optional dpiX As Single = 96, Optional dpiY As Single = 96)
Type | Name | Description |
---|---|---|
int | pixelWidth | The width of the image, in pixels. |
int | pixelHeight | The height of the image, in pixels. |
bool | opaque | Indicates if the alpha channel should be ignored. |
float | dpiX | The horizontal dpi of the image. |
float | dpiY | The vertical dpi of the image. |
Creates the image based on the existing pixel data to be read/modified in-place.
public void CreateImage(uint[] pixelData, int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, float dpiX = 96, float dpiY = 96)
Public Sub CreateImage(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 if 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. |
Creates the image based on the existing pixel data to be read/modified in-place.
public void CreateImage(IntPtr pixelData, int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, float dpiX = 96, float dpiY = 96)
Public Sub CreateImage(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 if 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. |