Class PixelBitmapContent<T>
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
public class PixelBitmapContent<T> : BitmapContent where T : struct, IEquatable<T>
Type Parameters
T
- Inheritance
-
PixelBitmapContent<T>
- Inherited Members
Constructors
PixelBitmapContent(int, int)
public PixelBitmapContent(int width, int height)
Parameters
Methods
GetPixel(int, int)
public T GetPixel(int x, int y)
Parameters
Returns
- T
GetPixelData()
Reads encoded bitmap content.
public override byte[] GetPixelData()
Returns
- byte[]
Array containing encoded bitmap data.
GetRow(int)
public T[] GetRow(int y)
Parameters
y
int
Returns
- T[]
ReplaceColor(T, T)
public void ReplaceColor(T originalColor, T newColor)
Parameters
originalColor
TnewColor
T
SetPixel(int, int, T)
public void SetPixel(int x, int y, T value)
Parameters
SetPixelData(byte[])
Writes encoded bitmap content.
public override void SetPixelData(byte[] sourceData)
Parameters
sourceData
byte[]Array containing encoded bitmap data to be set.
TryCopyFrom(BitmapContent, Rectangle, Rectangle)
Attempts to copy a region from a specified bitmap.
protected override bool TryCopyFrom(BitmapContent sourceBitmap, Rectangle sourceRegion, Rectangle destinationRegion)
Parameters
sourceBitmap
BitmapContentBitmapContent being copied.
sourceRegion
RectangleLocation of sourceBitmap.
destinationRegion
RectangleRegion of destination bitmap to be overwritten.
Returns
- bool
true if region copy is supported; false otherwise.
TryCopyTo(BitmapContent, Rectangle, Rectangle)
Attempts to copy a region of the specified bitmap onto another.
protected override bool TryCopyTo(BitmapContent destinationBitmap, Rectangle sourceRegion, Rectangle destinationRegion)
Parameters
destinationBitmap
BitmapContentBitmapContent being overwritten.
sourceRegion
RectangleLocation of the source bitmap.
destinationRegion
RectangleRegion of destination bitmap to be overwritten.
Returns
- bool
true if region copy is supported; false otherwise.
TryGetFormat(out SurfaceFormat)
Gets the corresponding GPU texture format for the specified bitmap type.
public override bool TryGetFormat(out SurfaceFormat format)
Parameters
format
SurfaceFormatFormat being retrieved.
Returns
- bool
The GPU texture format of the bitmap type.