imgLoadSizedSvgRw function

Pointer<SdlSurface> imgLoadSizedSvgRw(
  1. Pointer<SdlRWops> src,
  2. int width,
  3. int height
)

Load an SVG image, scaled to a specific size.

Since SVG files are resolution-independent, you specify the size you would like the output image to be and it will be generated at those dimensions.

Either width or height may be 0 and the image will be auto-sized to preserve aspect ratio.

When done with the returned surface, the app should dispose of it with a call to SDL_FreeSurface().

\param src an SDL_RWops to load SVG data from. \param width desired width of the generated surface, in pixels. \param height desired height of the generated surface, in pixels. \returns a new SDL surface, or NULL on error.

\since This function is available since SDL_image 2.6.0.

extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadSizedSVG_RW(SDL_RWops *src, int width, int height)

Implementation

Pointer<SdlSurface> imgLoadSizedSvgRw(
    Pointer<SdlRWops> src, int width, int height) {
  final imgLoadSizedSvgRwLookupFunction = libSdl2Image.lookupFunction<
      Pointer<SdlSurface> Function(
          Pointer<SdlRWops> src, Int32 width, Int32 height),
      Pointer<SdlSurface> Function(
          Pointer<SdlRWops> src, int width, int height)>('IMG_LoadSizedSVG_RW');
  return imgLoadSizedSvgRwLookupFunction(src, width, height);
}