pygame2.sdlimage – basic SDL_image wrapper module

Basic SDL_image wrapper module

Module Functions

pygame2.sdlimage.init(flags) → int

Initializes the library bindings of the underlying SDL_image library.

Initializes the library bindings of the underlying SDL_image library. This loads the dynamic libraries for PNG, JPG and TIF images and avoid multiple library loading/unloading calls.

NOTE: The call is optional.

pygame2.sdlimage.get_error() → :exc:`pygame2.Error`

Gets the last pygame2.Error occured.

SDL_image maintains an internal error message. This message will usually be given to you when a pygame2.Error is raised.

You will rarely need to call this function.

pygame2.sdlimage.load(file[, type]) → :class:`pygame2.sdl.video.Surface`

Loads an image file and creates a pygame2.sdl.video.Surface from it.

Loads an image file and creates a pygame2.sdl.video.Surface from it. The file argument can be a file object or filename. type is an optional argument indicating the image type as string.

Note

The file object must support binary read and write access. This is especially important for Python 3.x users.

pygame2.sdlimage.quit() → None

Deinitializes the library bindings of the underlying SDL_image library.

Deinitializes the library bindings of the underlying SDL_image library. This releases the loaded dynamic libraries for PNG, JPG and TIF images.

pygame2.sdlimage.read_xpm_from_array(buffer) → :class:`pygame2.sdl.video.Surface`

Creates a pygame2.sdl.video.Surface from a XPM buffer.

Creates a pygame2.sdl.video.Surface from a XPM buffer. The buffer can be any type that can be used as character buffer.