Jump to content
Search Community

Invert crop mask?

debu test
Moderator Tag

Recommended Posts

Hi,

 

I would like to make the crop mask inverted, IE so the selection rectangle is transparent and outside the selection rectangle has a darker mask. Any suggestions on how to do this?

 

Thanks, Dave

Link to comment
Share on other sites

While I realize that sounds simple, it's a pretty huge task. I think you'd have to overlay a large semi-transparent black box (easy), bring the crop to the top of the display list, and put a BitmapData inside the Crop DisplayObject that shows everything underneath that semi-transparent box. And of course you'd have to keep updating it as the Crop moves so that it appears to stay locked in place (using a Matrix in your draw()). Again, not exactly a simple task.

 

Maybe someone else has a better/easier idea.

Link to comment
Share on other sites

Thanks for the quick response - you gave me some good tips! I wasn't able to use the crop tool for the whole solution bit it provides the selection tool...

 

Here is what I wound up doing:

1) Drawing the crop tool on top of the image with no fill color.

2) Adding 2 shapes on the base image, a 'mask' drawn with a semi-transparent rectangle and a selection filled with the underlying image bits. The crop tool provided the selection rectangle. These are drawn in UpdateDisplayList()

3) Adding event listeners for MOVE and SCALE on the crop item to update the selection rectangle.

 

Thanks,

Dave

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...