Velaptor.Graphics.ImageData
Velaptor
Velaptor.Graphics
ImageData Struct
Holds image data such as the pixel colors for each X and Y location, the image width, and height.
public readonly struct ImageData :
System.IEquatable<Velaptor.Graphics.ImageData>
Implements System.IEquatable<ImageData>
Constructors
ImageData(Color[,], uint, uint, string) Constructor
Initializes a new instance of the ImageData struct.
public ImageData(System.Drawing.Color[,]? pixels, uint width, uint height, string filePath="");
Parameters
pixels
System.Drawing.Color[]
The pixel data of the image.
width
System.UInt32
The width of the image.
height
System.UInt32
The height of the image.
filePath
System.String
The file path of where the image exists.
Remarks
The filePath is used for reference only.
Properties
FilePath
Gets the file path of the image.
public string FilePath { get; }
Property Value
Remarks
This is only for reference.
Height
Gets the height of the image.
public uint Height { get; }
Property Value
IsFlippedHorizontally
Gets a value indicating whether or not the image is flipped horizontally.
public bool IsFlippedHorizontally { get; }
Property Value
IsFlippedVertically
Gets a value indicating whether or not the image is flipped vertically.
public bool IsFlippedVertically { get; }
Property Value
Pixels
Gets the pixel colors of the image.
public System.Drawing.Color[,] Pixels { get; }
Property Value
Remarks
The first dimension is the X location of the pixel and the second
dimension is the Y location of the pixel.
The 32-bit color component byte layout is ARGB.
Width
Gets the width of the image.
public uint Width { get; }
Property Value
Methods
DrawImage(ImageData, Point)
Draws the given image onto this image,
starting at the given location.
public Velaptor.Graphics.ImageData DrawImage(Velaptor.Graphics.ImageData image, System.Drawing.Point location);
Parameters
image
ImageData
The image to draw onto this one.
location
System.Drawing.Point
The location of where to draw the image.
References the top left corner of the given image.
Returns
ImageData
This current image with the given image painted onto it.
Remarks
If a pixel of the given image is out side of the bounds of this
image, it will be skipped.
Equals(ImageData)
Returns a value indicating whether or not this instance is equal to the given ImageData.
public bool Equals(Velaptor.Graphics.ImageData other);
Parameters
other
ImageData
The other data to compare.
Returns
System.Boolean
true
if equal.
FlipHorizontally()
Flips the image horizontally.
public void FlipHorizontally();
FlipVertically()
Flips the image vertically.
public void FlipVertically();
GetHashCode()
public override int GetHashCode();
Returns
IsEmpty()
Returns a value indicating whether or not the ImageData contents are empty.
public bool IsEmpty();
Returns
System.Boolean
true
if empty.
ToString()
public override string ToString();