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

# SDL\_LoadBMP\_IO(3)

Load a BMP image from a seekable SDL data stream.

## NAME

SDL\_LoadBMP\_IO - Load a BMP image from a seekable SDL data stream.

## HEADER FILE

Defined in SDL3/SDL\_surface.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Surface \* SDL\_LoadBMP\_IO(SDL\_IOStream \*src, bool closeio);**

## DESCRIPTION

The new surface should be freed with

**SDL\_DestroySurface** (). Not doing so will result in a memory leak.

## FUNCTION PARAMETERS

- *src*

  the data stream for the surface.

- *closeio*

  if true, calls  **SDL\_CloseIO** () on **src** before returning, even in the case of an error.

## RETURN VALUE

( **SDL\_Surface**\
  \*) Returns a pointer to a new

**SDL\_Surface**\
  structure or NULL on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_DestroySurface**(3)](/SDL_DestroySurface/3.md), **•**(3), [**SDL\_LoadBMP**(3)](/SDL_LoadBMP/3.md), **•**(3), [**SDL\_SaveBMP\_IO**(3)](/SDL_SaveBMP_IO/3.md)
