# BitmapData.draw()

**URL:** <https://forum.kirupa.com/t/bitmapdata-draw/269665>\
**Category:** Uncategorized\
**Created:** [August 30, 2008, 10:40am UTC](https://forum.kirupa.com/t/bitmapdata-draw/269665 "2008-08-30T10:40:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dataxa](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dataxa](https://forum.kirupa.com/u/dataxa)\
**Post date:** [August 30, 2008, 10:40am UTC](https://forum.kirupa.com/t/bitmapdata-draw/269665/1 "2008-08-30T10:40:33Z")

</div>

I have googeled, read the manuals but still don’t get it.

I need proper example of how you draw some specific portion of the MovieClip into BitmapData.  
I give function x:int, y:int, width:int, height:int parameters and it will return me BitmapData. Problem for me in this case is that i don’t know **how you position the clipping rectangle** so that you could get little part from the middle of the MovieClip.

I have written this code:

```auto
public function getBitmapData(x:int, y:int, width:int, height:int):Bitmap{
var cutArea:Rectangle = new Rectangle(x,y,width,height);
var bitmapMapData = new BitmapData(width,height);
bitmapMapData.draw(mapMC,null,null,null,cutArea);
var bitmapMap = new Bitmap(bitmapMapData);
return bitmapMap;
}

```

where mapMC is movieClip. This function does not give me exact result what i expect but i guess people who have done it know what is the problem.

Thanks in advance!
