Class TextureData
TextureData class
This class contains the raw data and format definition of a texture.
Constructors
Name | Description |
---|
TextureData() | Constructor of TextureData |
TextureData(int, int, PixelFormat) | Constructs a new TextureData and allocate pixel data. |
TextureData(int, int, int, int, PixelFormat, byte[]) | Constructor of TextureData |
Properties
Name | Description |
---|
BytesPerPixel { get; } | Number of bytes of a pixel |
Data { get; } | Raw bytes of pixel data |
Height { get; } | Number of vertical pixels |
PixelFormat { get; } | The pixel’s format |
Stride { get; } | Number of bytes of a scanline. |
Width { get; } | Number of horizontal pixels |
Methods
Name | Description |
---|
static FromFile(string) | Load a texture from file |
static FromStream(Stream) | Load a texture from stream |
MapPixels(PixelMapMode) | Map all pixels for read/write |
MapPixels(PixelMapMode, PixelFormat) | Map all pixels for read/write in given pixel format |
MapPixels(Rect, PixelMapMode, PixelFormat) | Map pixels addressed by rect for reading/writing in given pixel format |
Save(string) | Save texture data into image file |
Save(Stream, string) | Save texture data into specified image format |
Save(string, string) | Save texture data into image file |
TransformPixelFormat(PixelFormat) | Transform pixel’s layout to new pixel format. |
See Also