---
name: "IMG_ReadXPMFromArray"
section: "3"
platform: "linux"
package: "libsdl3-image-doc"
version: "3.2.4+ds-1+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/IMG_ReadXPMFromArray"
---

# IMG\_ReadXPMFromArray(3)

Load an XPM image from a memory array.

## NAME

IMG\_ReadXPMFromArray - Load an XPM image from a memory array.

## HEADER FILE

Defined in SDL3\_image/SDL\_image.h

## SYNOPSIS

```
#include "SDL3_image/SDL_image.h"
```

**SDL\_Surface \* IMG\_ReadXPMFromArray(char \*\*xpm);**

## DESCRIPTION

The returned surface will be an 8bpp indexed surface, if possible, otherwise it will be 32bpp. If you always want 32-bit data, use

**IMG\_ReadXPMFromArrayToRGB888** () instead.

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

## FUNCTION PARAMETERS

- *xpm*

  a null-terminated array of strings that comprise XPM data.

## RETURN VALUE

Returns a new SDL surface, or NULL on error.

## AVAILABILITY

This function is available since SDL\_image 3.0.0.

## SEE ALSO

**•**(3), [**IMG\_ReadXPMFromArrayToRGB888**(3)](/IMG_ReadXPMFromArrayToRGB888/3.md)
