Skip to main content

IMG_SaveTyped_IO

Function IMG_SaveTyped_IO 

Source
pub unsafe extern "C" fn IMG_SaveTyped_IO(
    surface: *mut SDL_Surface,
    dst: *mut SDL_IOStream,
    closeio: bool,
    type_: *const c_char,
) -> bool
Expand description

Save an SDL_Surface into formatted image data, via an SDL_IOStream.

If you just want to save to a filename, you can use IMG_Save() instead.

If closeio is true, dst will be closed before returning, whether this function succeeds or not.

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

Parameter: surface the SDL surface to save.

Parameter: dst the SDL_IOStream to save the image data to.

Parameter: closeio true to close/free the SDL_IOStream before returning, false to leave it open.

Parameter: type a filename extension that represent this data (“BMP”, “GIF”, “PNG”, etc).

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_Save

See Also: IMG_SaveAVIF_IO

See Also: IMG_SaveBMP_IO

See Also: IMG_SaveCUR_IO

See Also: IMG_SaveGIF_IO

See Also: IMG_SaveICO_IO

See Also: IMG_SaveJPG_IO

See Also: IMG_SavePNG_IO

See Also: IMG_SaveTGA_IO

See Also: IMG_SaveWEBP_IO