# .applyFilter to a certain area?

**URL:** https://forum.kirupa.com/t/applyfilter-to-a-certain-area/310341
**Category:** flash
**Created:** [June 8, 2010, 1:48am UTC](https://forum.kirupa.com/t/applyfilter-to-a-certain-area/310341 "2010-06-08T01:48:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![FreeHugs](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@FreeHugs](https://forum.kirupa.com/u/FreeHugs)
#### Post date: [June 8, 2010, 1:48am UTC](https://forum.kirupa.com/t/applyfilter-to-a-certain-area/310341/1 "2010-06-08T01:48:13Z")

</div>

Ahoy thar,

This is the one thing about bitmaps and bitmapData manipulation I really hate, trying to change something in one specific area never works out the way I thought it would ☹

My Problem is that I have a wide bitmapdata effect going horizontally across the page, for testing I just left the bitmapData be the height and width of the stage but I quickly discovered that this became unacceptable when I increased the size of the stage because the .applyFilter() method needs to compute the rest of the area too even though nothing is happening there. So then whipped up a quick function to find the bounding area of the visible effect, to keep it small (thankfully it will always be a rectangle) and I thought I might be able to shove that rectangle in one of the three different fields where it sounds like it might work… but nothing 😕 Every time the effect seemed to end up in some weird position or just have absolutely no effect :puzzled:  
(Iv tried it in the .applyFilter field, the .draw field and just setting the bitmap x/y to the bounding box x/y with the bitmapData width/height to the bounding box width/height, as well as some time throwing random formulas here and there trying to position it)

My question is, what is the easiest way to use .applyFilter on a known bounding rectangle?

P.S The effect is some moving waves drawn on a sprite canvas using .graphics then drawn to the bitmapData using .draw(), so anyway to use these to restrict the bitmapData area is oky doky too 🙂

Thanks in advance 🙂
