---
name: "al_get_parent_bitmap"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_get_parent_bitmap/3alleg5"
---

# al\_get\_parent\_bitmap(3alleg5)

Allegro 5 API

## NAME

al\_get\_parent\_bitmap - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  ALLEGRO_BITMAP *al_get_parent_bitmap(ALLEGRO_BITMAP *bitmap)
  ```

## DESCRIPTION

Returns the bitmap this bitmap is a sub-bitmap of. Returns NULL if this bitmap is not a sub-bitmap. This function always returns the real bitmap, and never a sub-bitmap. This might NOT match what was passed to al\_create\_sub\_bitmap(3alleg5). Consider this code, for instance:

-

  ```
  ALLEGRO_BITMAP* a = al_create_bitmap(512, 512);
  ALLEGRO_BITMAP* b = al_create_sub_bitmap(a, 128, 128, 256, 256);
  ALLEGRO_BITMAP* c = al_create_sub_bitmap(b, 64, 64, 128, 128);
  ASSERT(al_get_parent_bitmap(b) == a && al_get_parent_bitmap(c) == a);
  ```

The assertion will pass because only `a` is a real bitmap, and both `b` and `c` are its sub-bitmaps.

## SINCE

5\.0.6, 5.1.2

## SEE ALSO

al\_create\_sub\_bitmap(3alleg5), al\_is\_sub\_bitmap(3alleg5)
