Writes bitmap to an image file. Returns false for any other extension, for a bitmap that is not RGB8 or RGBA8, or when the write fails.
- filepath: where to write. The extension picks the format:
.png,.bmp,.tga,.jpgor.jpeg. - save_alpha: keeps the alpha channel of an
RGBA8bitmap. Off by default, which writes RGB.
bitmap: Bitmap;
bitmap_alloc(*bitmap, 16, 16, .RGB8);
defer deinit(*bitmap);
bitmap_save(*bitmap, "out.png");This one is only checked to compile, not run.
bitmap_save :: (bitmap: *Bitmap, filepath: string, save_alpha := false) -> bool
Writes bitmap to an image file. Returns false for any other extension, for a bitmap that is not RGB8 or RGBA8, or when the write fails.
Parameters
- bitmap: *Bitmap
- filepath: string
- where to write. The extension picks the format:
.png,.bmp,.tga,.jpgor.jpeg. - save_alpha := false
- keeps the alpha channel of an
RGBA8bitmap. Off by default, which writes RGB.
Returns
- bool
bitmap: Bitmap;
bitmap_alloc(*bitmap, 16, 16, .RGB8);
defer deinit(*bitmap);
bitmap_save(*bitmap, "out.png");This one is only checked to compile, not run.