Wednesday 15 September 2010

iphone - iOS - Best way to select an area of an image -


I'm looking for the best way to select an image area. Actually I want to load some jpgs, and let the user scale or move it, and get the coordinates on the image of a predecessor in the center of the picture. What is the best way to do that ? Does anyone know a library? Thank you in advance

The best way is to use the UIImagePickerController class.

You can navigate in this way:

  - (zero) Choose Photoform Library {UIImagePickerController * cameraUI = [[UIImagePickerController alloc] init]; CameraUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; // Shows controls for moving & amp; Scaling photos // To hide the control instead, use NO. CameraUI.allowsEditing = Yes; CameraUI.delegate = self; [Self-present ViewController: cameraUI animated: yes complete: zero]; }   

and then get the edited image like this:

  - (zero) imagePickerController: (UIImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSDictionary *) information {UIImage * Basic = Info [@ "UIImagePickerControllerEditedImage"]; // whatever you want with the image, [self-sharpening visual controller; unlimited: yes complete: zero]; }    

No comments:

Post a Comment