# Half-sized BitmapData

**URL:** https://forum.kirupa.com/t/half-sized-bitmapdata/265914
**Category:** flash
**Created:** [July 14, 2008, 3:00pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914 "2008-07-14T15:00:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sage\_of\_Fire](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sage\_of\_Fire](https://forum.kirupa.com/u/Sage_of_Fire)
#### Post date: [July 14, 2008, 3:00pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/1 "2008-07-14T15:00:52Z")

</div>

Well, I’m pretty stumped on this one. I’m using a BitmapData and a while loop to find the ground on my video game, but for some reason, the bitmapdata only gets half the sprite it’s based off. I know this because I printed it out as a bitmap. If I move the sprite before I capture the bitmapdata, it still only gets half, measured from the left edge of the stage. Anybody else ever had this problem?

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [July 14, 2008, 3:22pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/2 "2008-07-14T15:22:01Z")

</div>

usually this will happen if your graphics are centered in the object you’re drawing from, putting 0,0 in the center when draw() draws from 0,0 down and to the right. I don’t know if that’s what happening with you, but I thought I’d throw it out there.

---

<div class="post-metadata">

### Author: ![Sage\_of\_Fire](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sage\_of\_Fire](https://forum.kirupa.com/u/Sage_of_Fire)
#### Post date: [July 14, 2008, 3:50pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/3 "2008-07-14T15:50:04Z")

</div>

That sounds sort of like my problem, except that my draw() is drawing from the stage’s 0,0 coordinates instead of the sprite’s coordinates. I can’t think of why it would only get half, however. Here’s my code:

```auto

			currLevel = new LevelOne();
			
			currLevelBmd = new BitmapData(currLevel.width, currLevel.height);
			currLevelBmd.draw(currLevel);

```

Even if I call the draw() after I’ve moved the sprite (currLevel), it still gives me the same problems. All help is appreciated; I’m really stumped.

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [July 14, 2008, 4:09pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/4 "2008-07-14T16:09:07Z")

</div>

It depends what you’re moving and where. currLevelBmd will take the 0,0 location in currLevel and draw out to the right currLevel.width and down currLevel.height. Whatever is in that area appears in the bitmap.

---

<div class="post-metadata">

### Author: ![Sage\_of\_Fire](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sage\_of\_Fire](https://forum.kirupa.com/u/Sage_of_Fire)
#### Post date: [July 14, 2008, 5:18pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/5 "2008-07-14T17:18:01Z")

</div>

So, how do I change the 0, 0 location to the top corner and get the whole sprite, instead of a portion?

---

<div class="post-metadata">

### Author: ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)
#### Post date: [July 14, 2008, 5:52pm UTC](https://forum.kirupa.com/t/half-sized-bitmapdata/265914/6 "2008-07-14T17:52:40Z")

</div>

if you draw inside the class instead, it’ll use it’s position instead of its parent.
