简体   繁体   中英

Save image from camera or gallery in a canvas in phonegap and after rotate and crop it

Im novice in Phonegap, canvas, etc... and I have some problems with my project!

1- I need to capture the picture from gallery or camera, it works fine and the image is saved in a . The problem is that I should save the image from the gallery or camera in a canvas because after take the picture I need to do rotation with the image.

2- I tried to use kinetics.js to save the image in a canvas and with kinetics.js to do the rotation...but the problem is that my image is not available in the canvas in first time...you have to press "rotation button" and after you can see how the canvas is rotated with the image...I think that the problem is for the charge times with javascript, but I dont know how solve it.

Some can help me, please?? More or less this is the description for my problem, I need to do rotation with the image that I recieved from the camera or gallery and after save it in the image because I need to call to Jcrop.js to crop the image!!

Kind Regards!

I had an issue with the picture coming in sideways no matter what I took it with. I fixed this rotation issue with the following code:

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.DATA_URL, correctOrientation: true });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM