---
name: "get_rle_sprite"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/get_rle_sprite/3alleg4"
---

# get\_rle\_sprite(3alleg4)

Creates an RLE sprite using a bitmap as source. Allegro game programming library.

## NAME

get\_rle\_sprite - Creates an RLE sprite using a bitmap as source. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**RLE\_SPRITE \*get\_rle\_sprite(BITMAP \*bitmap);**

## DESCRIPTION

Creates an RLE sprite based on the specified bitmap (which must be a  memory bitmap). Remember to free this RLE sprite later to avoid memory leaks. Example:

```
   RLE_SPRITE *rle;
   BITMAP *bmp;
   ...
   /* Create RLE sprite from an existent bitmap. */
   rle = get_rle_sprite(bmp);
   if (!rle)
      abort_on_error("Couldn't create RLE sprite!");
   /* We don't need the bitmap any more.*/
   destroy_bitmap(bmp);
   /* Use the RLE sprite. */
   ...
   /* Destroy it when we don't need it any more. */
   destroy_rle_sprite(rle);
```

## RETURN VALUE

Returns a pointer to the created RLE sprite, or NULL if the RLE sprite could not be created. Remember to free this RLE sprite later to avoid memory leaks.

## SEE ALSO

**draw\_rle\_sprite**(3alleg4), **destroy\_rle\_sprite**(3alleg4)
