Skip to content
FutureBlitz

    Install

    Import std.image.bitmap

    Bmp

    std.image.bitmap

    struct

    Public Struct Bmp

    What reads and writes BMP images, in its Static Methods.

    Examples

    Local image = Image(2, 2)
    image.Fill(Color32.Blue)
    Local back = Try Bmp.Decode(Bmp.Encode(image))
    Expect(back[0, 0] == Color32.Blue)

    std/image/bitmap.fb, line 22

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOError static method #

      The image in data, a BMP of 1, 4, 8, 16, 24, or 32 bits a pixel. Throws an IOError of INVALID_DATA when the data isn't a BMP or is broken, and OTHER when it's run-length encoded, which stb_image doesn't read, or the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image): UInt8[] static method #

      The BMP of the image, 32 bits a pixel, with its alpha. Panics when it has no pixels.

    Report an issue with this page or with FutureBlitz on GitHub.