Show / Hide Table of Contents

    Interface IBitmap

    A low level bitmap which can be manipulated.

    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface IBitmap

    Properties

    | Improve this Doc View Source

    Height

    Gets the height of the bitmap (in pixels).

    Declaration
    int Height { get; }
    Property Value
    Type Description
    System.Int32

    The height.

    | Improve this Doc View Source

    Width

    Gets the width of the bitmap (in pixels).

    Declaration
    int Width { get; }
    Property Value
    Type Description
    System.Int32

    The width.

    Methods

    | Improve this Doc View Source

    ApplyArea(IAreaComponent)

    Create a new bitmap with only the pixels which are in the specified area, and makes all of the rest transparent.

    Declaration
    IBitmap ApplyArea(IAreaComponent area)
    Parameters
    Type Name Description
    IAreaComponent area

    Area.

    Returns
    Type Description
    IBitmap

    The new bitmap.

    | Improve this Doc View Source

    Clear()

    Clears the bitmap.

    Declaration
    void Clear()
    | Improve this Doc View Source

    CreateMask(IGameFactory, String, Boolean, Nullable<Color>, String, String)

    Creates a mask from the bitmap.

    Declaration
    IMask CreateMask(IGameFactory factory, string path, bool transparentMeansMasked = false, Color? debugDrawColor = default(Color? ), string saveMaskToFile = null, string id = null)
    Parameters
    Type Name Description
    IGameFactory factory

    The game factory.

    System.String path

    The path the bitmap was created from (will be used as the id for the debug mask image, if a debug draw color is given).

    System.Boolean transparentMeansMasked

    If set to true then a transparent pixel means masked, otherwise a non transparent pixel means masked.

    System.Nullable<Color> debugDrawColor

    An optional debug draw color, this will make the mask be saved as an image with the specified color.

    System.String saveMaskToFile

    An optional file path to the save the mask (for debugging purposes).

    System.String id

    A unique id which will be given to the mask (null will use the path as the id).

    Returns
    Type Description
    IMask

    The mask.

    | Improve this Doc View Source

    Crop(Rectangle)

    Creates a new bitmap which is cropped to the given rectangle.

    Declaration
    IBitmap Crop(Rectangle rectangle)
    Parameters
    Type Name Description
    Rectangle rectangle

    Rectangle.

    Returns
    Type Description
    IBitmap

    The new bitmap.

    | Improve this Doc View Source

    GetPixel(Int32, Int32)

    Gets the pixel color on the specified coordinates.

    Declaration
    Color GetPixel(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x

    The x coordinate.

    System.Int32 y

    The y coordinate.

    Returns
    Type Description
    Color

    The pixel color.

    | Improve this Doc View Source

    GetTextDraw()

    Allows to draw text on the bitmap.

    Declaration
    IBitmapTextDraw GetTextDraw()
    Returns
    Type Description
    IBitmapTextDraw

    The text draw.

    | Improve this Doc View Source

    LoadTexture(Nullable<Int32>)

    Uploads the bitmap to graphics memory, and optionally binds to a texture.

    Declaration
    void LoadTexture(int? textureToBind)
    Parameters
    Type Name Description
    System.Nullable<System.Int32> textureToBind

    Texture to bind.

    | Improve this Doc View Source

    MakeTransparent(Color)

    Replaces all pixels with the specified color to be transparent.

    Declaration
    void MakeTransparent(Color color)
    Parameters
    Type Name Description
    Color color

    Color.

    | Improve this Doc View Source

    SaveToFile(String)

    Saves the bitmap as an image to the specified file path.

    Declaration
    void SaveToFile(string path)
    Parameters
    Type Name Description
    System.String path

    Path.

    | Improve this Doc View Source

    SetPixel(Color, Int32, Int32)

    Sets a pixel color on the specified coordinates.

    Declaration
    void SetPixel(Color color, int x, int y)
    Parameters
    Type Name Description
    Color color

    Color.

    System.Int32 x

    The x coordinate.

    System.Int32 y

    The y coordinate.

    | Improve this Doc View Source

    SetPixels(Color, List<Point>)

    Sets multiple pixels with the specified color.

    Declaration
    void SetPixels(Color color, List<Point> points)
    Parameters
    Type Name Description
    Color color

    Color.

    System.Collections.Generic.List<Point> points

    Points.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX