imgSaveAnimation function image
Save an animation to a file.
For formats that accept a quality, a default quality of 90 will be used.
\param anim the animation to save. \param file path on the filesystem containing an animated image. \returns true on success or false on failure; call SDL_GetError() for more information.
\since This function is available since SDL_image 3.4.0.
\sa IMG_SaveAnimationTyped_IO \sa IMG_SaveANIAnimation_IO \sa IMG_SaveAPNGAnimation_IO \sa IMG_SaveAVIFAnimation_IO \sa IMG_SaveGIFAnimation_IO \sa IMG_SaveWEBPAnimation_IO
extern SDL_DECLSPEC bool SDLCALL IMG_SaveAnimation(IMG_Animation *anim, const char *file)
Implementation
bool imgSaveAnimation(Pointer<ImgAnimation> anim, String? file) {
final imgSaveAnimationLookupFunction = _libImage
.lookupFunction<
Uint8 Function(Pointer<ImgAnimation> anim, Pointer<Utf8> file),
int Function(Pointer<ImgAnimation> anim, Pointer<Utf8> file)
>('IMG_SaveAnimation');
final filePointer = file != null ? file.toNativeUtf8() : nullptr;
final result = imgSaveAnimationLookupFunction(anim, filePointer) == 1;
calloc.free(filePointer);
return result;
}