al_save_bitmap(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

al_save_bitmap β€” it's the Allegro 5 API, bestie πŸ’– (this page lives in the 3alleg5 manual, that's the whole vibe)


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro.h>

bool al_save_bitmap(const char *filename, ALLEGRO_BITMAP *bitmap)

🌸 DESCRIPTION 🌸

okay so picture this: you've got an ALLEGRO_BITMAP(3alleg5) and you want it to exist somewhere that isn't just RAM. you want it on disk. you want it to be a whole file. and that's literally exactly what al_save_bitmap does β€” it saves that bitmap to an image file. slay. πŸ’…

and how does it know what kind of file to write? the file type is determined by the extension. that's it. that's the whole mechanic. you name it .png, you get a PNG energy. it's giving "the filename is the instruction manual". iykyk πŸ¦‹

Returns true on success, false on error. so like, check it. don't just assume. πŸ™ˆ

Note: the core Allegro library does not support any image file formats by default. zero. none. nada. πŸ’€ you must use the allegro_image addon, or register your own format handler. no format handler, no saved bitmap, no exceptions.

πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! 🌈 go forth and save ur bitmaps, the file extension is literally your best friend, and remember: no image addon = no image formats, periodt πŸ‘‘πŸ’–

this has been the Allegro reference manual β€” the al_save_bitmap(3alleg5) page, Allegro 5 era, iconic behavior only βœ¨πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from