IMG_SaveBMP(3)

πŸ“¦
version 3.4.8 Β· 5 versions
, in fedora 43, fedora 44

πŸ’Ύ IMG_SaveBMP(3) πŸ’Ύ

okay bestie, welcome to the SDL_image3 corner of the man pages β€” this one's called IMG_SaveBMP, and it's literally just "put this surface in a BMP file, go off". ✨


🌸 NAME 🌸

IMG_SaveBMP β€” save an SDL_Surface into a BMP image file. that's it, that's the whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_image/SDL_image.h>

bool IMG_SaveBMP(SDL_Surface *surface, const char *file);

πŸ¦‹ DESCRIPTION πŸ¦‹

you hand it a surface, you hand it a path, it writes a BMP. no cap.

and listen β€” if the file already exists, it gets overwritten. like, no "are you sure?", no little prompt asking if you meant it. it's giving "main character energy" and it's just gonna replace whatever was there. so maybe double check that filename, bestie. 😭


✨ FUNCTION PARAMETERS ✨

  • surface β€” the SDL_Surface you wanna save. your little pixel baby. 🫢
  • file β€” the path on the filesystem to write the new file to. where it's gonna live. 🏠

πŸ’– RETURN VALUE πŸ’–

returns true on success or false on failure. and if it fails? call SDL_GetError() for more information β€” that's where the tea is. β˜•


⭐ AVAILABILITY ⭐

this function is available since SDL_image 3.4.0. so if you're on something older... nope, not there yet, sorry. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • IMG_SaveBMP_IO(3) β€” same vibe, but with an SDL_IOStream instead of a filename. iykyk. πŸ’œ

tiny reminder from your favorite unix girlie: overwriting is real and it is permanent. check twice, save once. πŸ’…

and that's the page!! 🌈 this one came to you from SDL_image, version SDL_image 3.4.8, filed under SDL_image in the IMG_SaveBMP(3) slot. mwah, go save some bitmaps, bestie. πŸ’–πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from