Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
How could i build an application that first in a blank UIView, then allow users to take a picture using camera, the picture will then appear on the UiView which users can drag and move the image around.
Here is my code that i have so far,
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
savebutton.hidden=NO;
}
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}
-(void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
NSString *message; NSString *title;
if (!error) {
title = NSLocalizedString(@"Image Saved Successfully!", @"");
message = NSLocalizedString(@"Tap Library and select this image.", @"");
}
else { title = NSLocalizedString(@"SaveFailedTitle", @""); message = [error description];
} UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:message delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil];
[alert show]; [alert release];
[message release]; [title release];}
-(IBAction) saveImage:(id)sender{
UIImage *img = imageView.image;
UIImageWriteToSavedPhotosAlbum(img, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), nil);
}
Also is there any good tutorial on photo modification in Xcode?
Many Thanks.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)