TextureData

TextureData class

This class contains the raw data and format definition of a texture.

public class TextureData

Constructors

Name Description
TextureData() Constructor of TextureData
TextureData(int, int, int, int, PixelFormat, byte[]) Constructor of TextureData (2 constructors)

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 FromBitmap(Bitmap) Convert a Bitmap to TextureData
static FromFile(string) Load a texture from file
static FromStream(Stream) Load a texture from stream
ToBitmap() Convert the TextureData to a Bitmap instance.

See Also