# Zoom with mask

**URL:** <https://forum.kirupa.com/t/zoom-with-mask/285517>\
**Category:** Uncategorized\
**Created:** [April 1, 2009, 8:13pm UTC](https://forum.kirupa.com/t/zoom-with-mask/285517 "2009-04-01T20:13:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel\_mihalcea](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@daniel\_mihalcea](https://forum.kirupa.com/u/daniel_mihalcea)\
**Post date:** [April 1, 2009, 8:13pm UTC](https://forum.kirupa.com/t/zoom-with-mask/285517/1 "2009-04-01T20:13:40Z")

</div>

Hello there. I have to do I zoom In/Out function with a mask. Scenario: I have a big image and I have to do zoom on it only once and the problem is that my zoomed image must be in a panel(invisible, like a mask), so when I zoom the image the width and height of the image do not affect my stage, like google maps. And I have to be able to pan the image when I zoom in. I do not know how to set that mask so my image do my get off the stage. If you know what I mean. This is my code for the moment.  
main.\_x = (Stage.width - main.\_width)/2;  
main.\_y = (Stage.height - main.\_height)/2;

zoomIn\_btn.onRelease = function()  
{  
zoomIn\_btn.enabled = false;  
zoomOut\_btn.enabled = true;  
main.\_height = main.\_height_1.5;  
main.\_width = main.\_width_1.5;  
main.\_x = (Stage.width - main.\_width)/2;  
main.\_y = (Stage.height - main.\_height)/2;  
}

zoomOut\_btn.onRelease = function()  
{  
zoomIn\_btn.enabled = true;  
zoomOut\_btn.enabled = false;

```
main._height = main._height/1.5;
main._width = main._width/1.5;
main._x = (Stage.width - main._width)/2;
main._y = (Stage.height - main._height)/2;

```

}

Thank you.
