Jump to content
Search Community

Crop face area

helio test
Moderator Tag

Recommended Posts

I create application where user upload photo from local computer, and then scaling and rotating photo using slider. I use TransformManager. I want crop only face when user click on button. Here screenshot similar application

 

UfBANR.png

After click next button image cropping.

 

vIm2qf.png

But I don't know how to crop image without double clicking on image and then choose area. I disable scale and rotation handle and using only slider.  For example. I have image inside sprite. Image have size 2000x2000. After change scaleX and scaleY using slider, image size have 800x800. My crop area 330x354. How to crop image using this crop area. And how to update image size in crop.update() method then I change image size. Here full http://pastebin.com/ZZJ9RhH7.

  • Like 1
Link to comment
Share on other sites

You should be able to accomplish almost anything directly through code (rather than relying on user interaction). For example the "Crop" class has a "cropMode" property that you can set to true or false. Setting it to true should kick it into cropping mode, and you can move/scale it as you please. 

 

http://greensock.com/as/docs/transform/com/greensock/transform/Crop.html

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...