Skip to main content
Version: 1.0.0-preview.34

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

System.String

Remarks

This is only for reference.

Height

Gets the height of the image.

public uint Height { get; }

Property Value

System.UInt32

IsFlippedHorizontally

Gets a value indicating whether or not the image is flipped horizontally.

public bool IsFlippedHorizontally { get; }

Property Value

System.Boolean

IsFlippedVertically

Gets a value indicating whether or not the image is flipped vertically.

public bool IsFlippedVertically { get; }

Property Value

System.Boolean

Pixels

Gets the pixel colors of the image.

public System.Drawing.Color[,] Pixels { get; }

Property Value

System.Drawing.Color[]

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

System.UInt32

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

System.Int32

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();

Returns

System.String