class Bitmap
😔 No documentation found.
public void Clear( Color color )
Clears the bitmap to the specified color.
colorThe color to fill the bitmap with.
public Color GetPixel( int x, int y )
Retrieves the color of a specific pixel in the bitmap.
xThe x-coordinate of the pixel.yThe y-coordinate of the pixel.- Returns The color of the pixel at the specified coordinates.
public void SetPixel( int x, int y, Color color )
Sets the color of a specific pixel in the bitmap.
xThe x-coordinate of the pixel.yThe y-coordinate of the pixel.colorThe color to set the pixel to.
public void DrawRect( Rect rect )
Draws a rectangle using the current pen settings.
rectThe rectangle to draw.
public void DrawRect( float x, float y, float width, float height )
Draws a rectangle using the current pen settings.
xThe x-coordinate of the top-left corner.yThe y-coordinate of the top-left corner.widthThe width of the rectangle.heightThe height of the rectangle.
public void DrawRoundRect( Rect rect, Margin margins )
Draws a rectangle using the current pen settings.
public void DrawCircle( Vector2 center, float radius )
Draws a circle using the current pen settings.
centerThe center of the circle.radiusThe radius of the circle.
public void DrawCircle( float x, float y, float radius )
Draws a circle using the current pen settings.
xThe x-coordinate of the circle's center.yThe y-coordinate of the circle's center.radiusThe radius of the circle.
public void DrawPolygon( Vector2[] points )
Draws a polygon using the current pen settings.
pointsThe points of the polygon.
public void DrawArc( Rect rect, float startAngle, float sweepAngle )
Draws an arc using the current pen settings.
rectThe bounding rectangle of the arc.startAngleThe starting angle of the arc, in degrees.sweepAngleThe sweep angle of the arc, in degrees.
public void DrawArc( Rect rect, float startAngle, float sweepAngle, bool useCenter )
Draws an arc using the current pen settings, with an option to connect to the center.
rectThe bounding rectangle of the arc.startAngleThe starting angle of the arc, in degrees.sweepAngleThe sweep angle of the arc, in degrees.useCenterIf true, connects the arc endpoints to the center point, forming a pie shape.
public void DrawBitmap( Bitmap bitmap, Rect destRect )
Draws another bitmap onto this bitmap.
bitmapThe bitmap to draw.destRectThe destination rectangle for the drawn bitmap.
public void DrawLine( Vector2 start, Vector2 end )
Draws a line using the current pen settings.
startThe starting point of the line.endThe ending point of the line.
public void DrawLines( Vector2[] points )
Draws connected lines through a series of points using the current pen settings.
pointsThe points to connect with lines.
public void Blur( float radius, bool tileClamp = True )
Applies a Gaussian blur effect to the current bitmap.
radiusThe radius of the blur, controlling its intensity. Must be non-negative.tileClampDetermines the behavior at the edges of the bitmap: true to clamp the edges (default), or false to repeat the edges.
public void Sharpen( float amount, bool tileClamp = True )
Applies a Gaussian blur effect to the current bitmap.
public void Adjust( float brightness = 1, float contrast = 1, float saturation = 1, float hueDegrees = 0 )
Adjusts brightness, contrast, and saturation in one pass.
public void AdjustHue( float angle )
Adjusts the hue of the bitmap.
angleThe angle to rotate the hue, in degrees (0 to 360).
public void Colorize( Color color )
Color the bitmap using this color, respect alpha
public void InsertPadding( Margin margin )
Shrink the image by adding padding all around - without resizing the bitmap
public Bitmap HeightmapToNormalMap( float strength = 1 )
Converts a heightmap to a normal map using parallel processing.
strengthThe strength of the normal map effect (default is 1.0).- Returns The generated normal map as an SKBitmap.
public static Bitmap CreateFromBytes( byte[] data )
Loads a bitmap from the specified byte array.
dataThe byte array containing the image data.- Returns A new instance.
public static bool IsIes( byte[] data )
Return true if this data is a Ies file
public static Bitmap CreateFromPsdBytes( byte[] data )
Creates a Bitmap instance from PSD file data.
dataByte array containing the PSD file data.- Returns A Bitmap instance if successful, or null if the data is not valid PSD.
public static bool IsPsd( byte[] data )
Checks if the provided byte array is a valid PSD file.
dataByte array to check.- Returns True if the data is a PSD file, otherwise false.
public static bool IsTga( byte[] data )
Return true if this data is a Tga file
public void SetAntialias( bool on )
Sets the pen for drawing with a solid color and stroke style.
public void SetBlendMode( BlendMode blendMode )
Sets the pen to use a specific blend mode.
blendModeThe blend mode to apply.
public void SetPen( Color color, float width )
Sets the pen for drawing with a solid color and stroke style.
colorThe color of the pen.widthThe width of the pen in pixels.
public void SetDashedPen( Color color, float width, float[] dashPattern )
Sets the pen for drawing dashed or dotted lines.
colorThe color of the pen.widthThe width of the pen in pixels.dashPatternAn array defining the dash pattern (e.g., [10, 5] for 10px dash, 5px gap).
public void SetFill( Color color )
Sets the pen for drawing filled shapes with a solid color.
colorThe color to fill the shapes with.
public void SetLinearGradient( Vector2 start, Vector2 end, Gradient gradient )
Sets the pen for drawing with a linear gradient.
startthe gradient's start point.endthe gradient's end point.gradientThe color of the gradient.
public void SetRadialGradient( Vector2 center, float radius, Gradient gradient )
Sets the pen for drawing with a radial gradient.
centerThe gradient's center.radiusThe radius of the gradient.gradientThe color of the gradient.
public byte[] ToJpg( int quality = 100 )
Exports the bitmap as a JPEG byte array with the specified quality.
qualityThe quality of the JPEG, between 0 and 100.- Returns A byte array containing the JPEG image data.
public byte[] ToWebP( int quality = 100 )
Exports the bitmap as an HDR WebP byte array with the specified quality.
qualityThe quality of the WebP image, between 0 and 100.- Returns A byte array containing the WebP HDR image data.
public byte[] ToFormat( ImageFormat format )
Exports the bitmap to the specified engine format
public void DrawText( TextRendering.Scope scope, Rect rect, TextFlag flags = Center )
Draws text onto this bitmap
public Texture ToTexture( bool mips = True )
Try to create a texture from this bitmap
public Bitmap Rotate( float degrees )
Rotates the bitmap by the specified angle.
degreesThe angle in degrees to rotate the bitmap.- Returns A new instance with the rotated image.
public Bitmap Resize( int newWidth, int newHeight )
Resizes the bitmap to the specified dimensions and returns a new bitmap.
newWidthThe new width of the bitmap.newHeightThe new height of the bitmap.- Returns A new instance with the specified dimensions.
public Bitmap Crop( Rect rect )
Crops the bitmap to the specified rectangle.
rectThe rectangle to crop to.- Returns A new instance with the cropped image.
public bool Equals( object obj )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public Bitmap FlipHorizontal( )
😔 No documentation found.
public Bitmap FlipVertical( )
😔 No documentation found.
public byte[] ToBmp( )
😔 No documentation found.
public byte[] ToPng( )
😔 No documentation found.
public Bitmap( int width, int height, bool floatingPoint = False )
😔 No documentation found.
public int Width { get; }
😔 No documentation found.
public int Height { get; }
😔 No documentation found.
public int BytesPerPixel { get; }
😔 No documentation found.
public int ByteCount { get; }
😔 No documentation found.
public Rect Rect { get; }
😔 No documentation found.
public Vector2 Center { get; }
😔 No documentation found.
public bool IsFloatingPoint { get; set; }
😔 No documentation found.
public bool IsValid { get; }
😔 No documentation found.
public void Dispose( )
😔 No documentation found.
public static bool IsTif( ReadOnlySpan<byte> data )
😔 No documentation found.
public Color[] GetPixels( )
😔 No documentation found.
public Color32[] GetPixels32( )
😔 No documentation found.
public Bitmap Clone( )
😔 No documentation found.
public bool IsOpaque( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public void InvertColor( )
😔 No documentation found.
public static Bitmap CreateFromIesBytes( byte[] data )
😔 No documentation found.
public static Bitmap CreateFromSvgString( string svgContents, Nullable<int> width, Nullable<int> height, Nullable<Vector2> scale = null, Nullable<Vector2> offset = null, Nullable<float> rotation = null )
😔 No documentation found.
public static Bitmap CreateFromTgaBytes( byte[] data )
😔 No documentation found.
public Color.Rgba16[] GetPixels16( )
😔 No documentation found.
public static Bitmap CreateFromTifBytes( byte[] data )
😔 No documentation found.