Skip to main content

IMG_Save

Function IMG_Save 

Source
pub unsafe extern "C" fn IMG_Save(
    surface: *mut SDL_Surface,
    file: *const c_char,
) -> bool
Expand description

Save an SDL_Surface into an image file.

If the file already exists, it will be overwritten.

For formats that accept a quality, a default quality of 90 will be used.

Parameter: surface the SDL surface to save.

Parameter: file path on the filesystem to write new file to.

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

Available Since: This function is available since SDL_image 3.4.0.

See Also: IMG_SaveTyped_IO

See Also: IMG_SaveAVIF

See Also: IMG_SaveBMP

See Also: IMG_SaveCUR

See Also: IMG_SaveGIF

See Also: IMG_SaveICO

See Also: IMG_SaveJPG

See Also: IMG_SavePNG

See Also: IMG_SaveTGA

See Also: IMG_SaveWEBP