public class Editor.Pixmap
A pixel map, or just a simple image.
Constructors
Showing 2 constructors
No results match this filter.
Methods
Showing 18 methods
protected virtual override void Finalize()
public static Editor.Pixmap FromFile(string filename)
Load an image from a file on disk, specifically from "core/tools/images".
public static Editor.Pixmap FromTexture(Sandbox.Texture texture, bool withAlpha = True)
Create a pixmap from a texture.
Parameters
withAlpha: Default: True
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.
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.
Parameters
quality: JPEG quality, 0 to 100.
public Color GetPixel(int x, int y)
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.
public bool SaveJpg(string filename, int quality = 70)
Save the pixel map as a JPEG file at given location.
Parameters
filename: A full, valid absolute target path. Will not create directories on its own.quality: JPEG quality, 0 to 100. Default: 70
Returns
Whether the file was created or not.
public bool SavePng(string filename)
Save the pixel map as a PNG file at given location.
Parameters
filename: A full, valid absolute target path. Will not create directories on its own.
Returns
Whether the file was created or not.
No results match this filter.
Properties
Showing 4 properties
public bool Editor.Pixmap.HasAlpha { get; set; }
Whether this pixel map supports the alpha channel.
public int Editor.Pixmap.Height { get; set; }
Height of the pixel map.
public int Editor.Pixmap.Width { get; set; }
Width of the pixel map.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Editor |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.Pixmap |