IMG_SaveBMP_IO(3)

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

πŸ’Ύ IMG_SaveBMP_IO(3) β€” the SDL_image3 functions era πŸ’Ύ

okay bestie, sit down, hydrate, because we're talking about IMG_SaveBMP_IO β€” she lives in the SDL_image3 FUNCTIONS section of the manual and she is literally the "save my surface as a BMP but through a stream" girlie. no cap.


✨ NAME ✨

IMG_SaveBMP_IO β€” save an SDL_Surface into BMP image data, via an SDL_IOStream. that's it, that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3_image/SDL_image.h>

bool IMG_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio);

look at her. three args, one bool back. clean, iconic, no notes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: if you just wanna save to a filename, you do not need this function β€” use IMG_SaveBMP() instead. that one's for the girlies who already have a path. this one's for the girlies who have a stream. different energy, same BMP. ✨

and listen, this part matters: if closeio is true, then dst will be closed before returning β€” whether this function succeeds or not. success? closed. failure? also closed. she does not play about closing. 😭


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • surface β€” the SDL_Surface you wanna save. your pixels, your masterpiece, your main character. πŸ‘‘
  • dst β€” the SDL_IOStream you're saving the image data to. the destination, the moment, the whole point. 🌈
  • closeio β€” true if you want the SDL_IOStream closed/freed before returning, false if you want it left open. pick wisely bestie, this is a one-way door for that stream. πŸ’€

⭐ RETURN VALUE ⭐

returns true on success, or false on failure. and if it's false? call SDL_GetError() for more info, because she's not gonna elaborate on her own. go ask. 🫢

fr fr: false means something went sideways β€” SDL_GetError() is your group chat receipt.

πŸ’œ AVAILABILITY πŸ’œ

this function has been available since SDL_image 3.4.0. so if you're on something older, no she's not there. upgrade era only. 🧚


πŸ”₯ SEE ALSO πŸ”₯

  • IMG_SaveBMP(3) β€” the filename girlie. your other option. go say hi. πŸ“

and that's the whole page, bestie!! sourced from SDL_image, version SDL_image 3.4.8 β€” slay, periodt, go save some BMPs responsibly. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from