Pixmapclass
A pixel map, or just a simple image.
Constructors2
Showing 2 constructors
No results match this filter.
Methods18
Showing 18 methods
public void Clear(Color color)
Fill the pixel map with given color.
| Parameter | Type | Description |
|---|---|---|
| color | Color | — |
void—protected virtual override void Finalize()
void—public static Editor.Pixmap FromBitmap(Sandbox.Bitmap bitmap)
Create a pixmap from a bitmap
| Parameter | Type | Description |
|---|---|---|
| bitmap | Bitmap | — |
public static Editor.Pixmap FromFile(string filename)
Load an image from a file on disk, specifically from "core/tools/images".
| Parameter | Type | Description |
|---|---|---|
| filename | string | — |
public static Editor.Pixmap FromTexture(Sandbox.Texture texture, bool withAlpha = True)
Create a pixmap from a texture.
| Parameter | Type | Description |
|---|---|---|
| texture | Texture | — |
| withAlpha = True | bool | — |
public byte[] GetBmp(int quality)
Returns the raw bytes of a BMP file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
| Parameter | Type | Description |
|---|---|---|
| quality | int | — |
byte[]—public byte[] GetJpeg(int quality)
Returns the raw bytes of a JPEG file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
| Parameter | Type | Description |
|---|---|---|
| quality | int | JPEG quality, 0 to 100. |
byte[]—public byte[] GetPng()
Returns the raw bytes of a PNG file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
byte[]—public bool SaveJpg(string filename, int quality = 70)
Save the pixel map as a JPEG file at given location.
| Parameter | Type | Description |
|---|---|---|
| filename | string | A full, valid absolute target path. Will not create directories on its own. |
| quality = 70 | int | JPEG quality, 0 to 100. |
boolWhether the file was created or not.public bool SavePng(string filename)
Save the pixel map as a PNG file at given location.
| Parameter | Type | Description |
|---|---|---|
| filename | string | A full, valid absolute target path. Will not create directories on its own. |
boolWhether the file was created or not.No results match this filter.
Properties4
Showing 4 properties
public bool Editor.Pixmap.HasAlpha { get; set; }
Whether this pixel map supports the alpha channel.
bool—public int Editor.Pixmap.Height { get; set; }
Height of the pixel map.
int—public int Editor.Pixmap.Width { get; set; }
Width of the pixel map.
int—No results match this filter.