SDL_SavePNG(3)

NAME
SDL_SavePNG - Save a surface to a file in PNG format.

SYNOPSIS
#include <SDL3/SDL_surface.h>

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

FUNCTION PARAMETERS

surface
    the SDL_Surface structure containing the image to be saved.

file
    a file to save to.

RETURN VALUE
Returns true on success or false on failure; call SDL_GetError() for more information.

THREAD SAFETY
This function can be called on different threads with different surfaces.

AVAILABILITY
This function is available since SDL 3.4.0.

SEE ALSO
SDL_LoadPNG(3), SDL_SavePNG_IO(3)