---
name: "stretch_sprite"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/stretch_sprite"
---

# stretch\_sprite(3alleg)

Stretches a sprite to the destination bitmap. Allegro game programming library.

## NAME

stretch\_sprite - Stretches a sprite to the destination bitmap. Allegro game programming library.

## SYNOPSIS

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

**void stretch\_sprite(BITMAP \*bmp, BITMAP \*sprite, int x, int y, int w, int h);**

## DESCRIPTION

Like draw\_sprite(), except it can stretch the sprite image to the  specified width and height and requires the sprite image and destination  bitmap to be of the same color depth. Moreover, the sprite image must  be a memory bitmap. Example:

```
   /* Create tunnel like effect. */
   for (step = 1; step
      int width = SCREEN_W / step;
      int height = SCREEN_H / step;
      stretch_sprite(screen, image, SCREEN_W / 2 - width / 2,
                     SCREEN_H / 2 - height / 2, width, height);
   }
```

## SEE ALSO

[**draw\_sprite**(3alleg)](/draw_sprite/3alleg.md), [**stretch\_blit**(3alleg)](/stretch_blit/3alleg.md), [**bitmap\_mask\_color**(3alleg)](/bitmap_mask_color/3alleg.md)
