# bitmapData's dimensions (width and height)

**URL:** <https://forum.kirupa.com/t/bitmapdatas-dimensions-width-and-height/326907>\
**Category:** flash\
**Created:** [January 20, 2012, 6:11pm UTC](https://forum.kirupa.com/t/bitmapdatas-dimensions-width-and-height/326907 "2012-01-20T18:11:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drpelz](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@drpelz](https://forum.kirupa.com/u/drpelz)\
**Post date:** [January 20, 2012, 6:11pm UTC](https://forum.kirupa.com/t/bitmapdatas-dimensions-width-and-height/326907/1 "2012-01-20T18:11:09Z")

</div>

Hi,

I’m new to flex and I have a question concerning bitmapData and its width and height.

Normally you set up bitmapData like this in AS3:

```auto

var bd:BitmapData = new BitmapData(100, 100, true, 0x00000000);
var bm:Bitmap = new Bitmap(bd);

```

But in Flex embedding an an image works like this:

```auto

[Embed(source="../../../../../assets/sprites/asteroids/asteroid_32_full.gif")]
public static const Asteroid1:Class;
var imageBM:Bitmap = new Library.Asteroid1();

```

When using the bitmapData (e.g. imageBM.bitmapData) I don’t have to set up width and height any more. Does the Flash player know the width and height of a bitmapData automatically even when NOT setting up the bitmapData’s width and height? I’m totally unaware about this topic because I don’t know whether the Flash player always knows the dimensions of a bitmapData. Could this cause problems when not setting up the dimensions of a bitmapData? Thank you very much.
