Share Posted January 24, 2014 Hello, I am using crop feature, but facing one problem when user move the crop control, the control 's line and mask are not in sync (Refer attached image). So is there any property or settings that need to apply on control. Refer the below code. var manager:TransformManager = new TransformManager(); manager.lockPosition = false; manager.lockRotation = false; manager.lockScale = false; var cropControl:FlexCrop = new FlexCrop( imageObj, manager, true); cropControl.configureCropMode(false, 0.5, 0xFFCC12, true); Link to post Share on other sites
Author Share Posted January 24, 2014 Hi Jack, Don't spend time for above issue, now its working fine with following change: var cropControl:FlexCrop = new FlexCrop(cropImageObj, flxTransformManagerObj.manager, true); Thanks Bharat 2 Link to post Share on other sites
Share Posted January 24, 2014 Excellent, thanks for letting us know. Link to post Share on other sites
Share Posted February 18, 2014 hello, I'm trying to bound crop with image component but when i rotate image then perform crop image is shrinking and out of Transform Manager... if u have any suggestion for this then plz let me know.,.. Thank u http://i.picresize.com/kPR Link to post Share on other sites
Share Posted February 18, 2014 KnightRider, it's very difficult to know what's happening without seeing a reduced test case that clearly demonstrates the issue (without extra code). If you still need help, please upload an FLA that we can publish (you can click the "More Reply Options" button below to attach a file). Link to post Share on other sites
Share Posted February 19, 2014 private function init():void{ //rect for bounding image within canvas _rect=new Rectangle(0,0,canvas.width,canvas.height); _manager.bounds=_rect; _fCrop = new FlexCrop(_imgC,_manager); _fCrop.configureCropMode(false,.5,0xAACCBB,true); _fCrop.addEventListener("enterCropMode",sCrop);}private function sCrop(e:Event):void{ //_rect=_manager.getSelectionBounds(); //_rect for bounding crop within image component _rect=new Rectangle(_imgC.x,_imgC.y,_imgC.width*_imgC.scaleY,_imgC.height*_imgC.scaleY); _manager.lockRotation=true;//lock rotation of crop _manager.bounds=_rect;} before rotation its working well crop is bounded with in image After rotation img1 After rotation img2 Link to post Share on other sites
Share Posted February 19, 2014 It's tough to say without a reduced case FLA, but width and height are supposed to include any scaling (at least that's what Adobe's docs say and it is how things work in Flash normally), but I know there are some Flex components that behave differently and report width/height without including scaling. When you rotate, that probably further complicates things, as you'd need to do the math to figure out sin/cos, and apply them accordingly. It looks like this isn't really a TransformManager issue at all, but rather something with your particular function and possibly a Flex quirk which we can't do much about unfortunately. I wish I had an easy answer for you. 1 Link to post Share on other sites