IMG_LoadSizedSVG_IO(3)

πŸ¦‹ IMG_LoadSizedSVG_IO(3) πŸ¦‹

okay so bestie, you found the SDL_image3 FUNCTIONS page for IMG_LoadSizedSVG_IO, and it’s giving β€œI want an SVG, but at my exact size” energy. ✨


πŸ’– NAME πŸ’–

IMG_LoadSizedSVG_IO β€” Load an SVG image, scaled to a specific size.

✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

SDL_Surface * IMG_LoadSizedSVG_IO(SDL_IOStream *src, int width, int height);

🌸 DESCRIPTION 🌸

SVG files are resolution-independent, so you literally tell this function what size you want the output image to be, and it generates the image at those exact dimensions. 😌 no cap.

Either width or height can be 0, and then the image auto-sizes itself to preserve the aspect ratio. 🫢

When you’re done with the returned surface, the app should dispose of it with a call to SDL_DestroySurface(). Don’t leave your surface hanging, bestie. πŸ’…

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • src β€” an SDL_IOStream to load SVG data from.
  • width β€” desired width of the generated surface, in pixels.
  • height β€” desired height of the generated surface, in pixels.

πŸ’œ RETURN VALUE πŸ’œ

Returns a new SDL_Surface, or NULL on error. Simple as that. ✨

🌈 AVAILABILITY 🌈

This function is available since SDL_image 3.0.0. πŸ—“οΈ

πŸ¦‹ SEE ALSO πŸ¦‹


and that’s the whole vibe. this page is from the SDL_image 3.4.4 manual β€” the footer doesn’t list a date, so no fake tea from me, periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from