I implemented camera roll on my game with flash Media Event. Now, i want to have cropping functionality. Once i take photo from my gallery, how to crop before upload it to my game like cropping on black berry messenger dp on android phone? I'm using starling, AIR, flash and as3 codes.
Asked
Active
Viewed 385 times
1 Answers
0
Question isn't related to starling. With google you can find a lot of cropping technics, for example this http://shaun.boyblack.co.za/blog/2008/08/29/image-resizing-and-cropping-utility/ and this http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle There is not so much difference between starling display objects and traditional flash. So you code may be looking like this:
protected var myCam:CameraUI;
...
myCam = new CameraUI();
myCam.addEventListener(MediaEvent.COMPLETE, onComplete);
myCam.launch(MediaType.IMAGE);
...
protected function onComplete(e:MediaEvent):void
{
//getting the url to image file
var file:File = e.data.file;
trace(file.nativePath); //or
trace(file.url);
//then you can download image and crop it with any technic as simple bitmap
//then use it for Texture and show it in starling
//then upload it to server
}

Dmitry Malugin
- 882
- 1
- 7
- 25
-
Thanks for the responses. How about if i want user crop the image uploaded like cropping display picture on black berry messenger or on instagram. – Andri Wu Feb 17 '15 at 09:30
-
I never see black berry messenger but as far as I understand it similar to the technic I gave earlier see this http://blog.soulwire.co.uk/wp-content/uploads/2009/05/displayutils.swf – Dmitry Malugin Feb 18 '15 at 06:27