# DisplayObject.cacheAsBitmap Problem

**URL:** <https://forum.kirupa.com/t/displayobject-cacheasbitmap-problem/239392>\
**Category:** flash\
**Created:** [September 21, 2007, 7:27am UTC](https://forum.kirupa.com/t/displayobject-cacheasbitmap-problem/239392 "2007-09-21T07:27:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![endemoniada](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@endemoniada](https://forum.kirupa.com/u/endemoniada)\
**Post date:** [September 21, 2007, 7:27am UTC](https://forum.kirupa.com/t/displayobject-cacheasbitmap-problem/239392/1 "2007-09-21T07:27:22Z")

</div>

Hi guys,

I’m applying a filter to my Bitmap object so the cacheAsBitmap is automatically overridden and set to true.

It’s causing problems when I indirectly resize the Bitmap by changing it’s BitmapData.

Like this:

if(bitmapData)  
bitmapData.dispose();

bitmapData=new BitmapData(newWidth,newHeight,true,0x00000000);

…it stays the old size.

I can do this to fix it but maybe there is a better way:

filters=null;

// same as above

filters=myFilterArray;

What do you think ?
