Tao.Sdl SDK Documentation

SdlImage.IMG_ReadXPMFromArray Method 

Load a .XPM image from an array.

[Visual Basic]
Public Shared Function IMG_ReadXPMFromArray( _
   ByVal src As String() _
) As IntPtr
[C#]
public static IntPtr IMG_ReadXPMFromArray(
   string[] src
);

Parameters

src
The source xpm data. The XPM image is loaded from this.

Return Value

a pointer to the image as a new SDL_Surface. NULL is returned on errors, like if XPM is not supported, or a read error.

Remarks

Load src as a XPM image for use as a surface, if XPM support is compiled into the SDL_image library.

Binds to C-function in SDL_image.h

            SDL_Surface *IMG_ReadXPMFromArray(char **xpm)
            

Example

            // load sample.xpm into image
            #include "sample.xpm"
                    SDL_Surface *image;
                    image=IMG_ReadXPMFromArray(sample_xpm);
                    if(!image)
                {
                    printf("IMG_ReadXPMFromArray: %s\n", IMG_GetError());
                    // handle error
                }
            

See Also

SdlImage Class | Tao.Sdl Namespace | IMG_LoadXPM_RW