などの「編集」funcitionalityでフォトライブラリやカメラから画像を取得するために、私はios4.2.1iPhone:どのようにiPhoneの写真アプリ
でフォトライブラリやカメラから画像を取得する方法を知っているが、IOS 5の新機能があります写真アプリでは、画像やトリミング画像を編集したい場合など、そのようなことをすることができます。
私はカメラや写真のライブラリから画像をつかむ時に私のアプリに実装したいと同じ機能。
私は、IOS 5にも、IOSの4.2.1作品画像をフェッチしますが、このコードによって、私は私の画像を編集したり、トリミングすることはできませんよそれによってコード。
- (IBAction)btnCapturePressed:(id)sender {
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
ipc=[[UIImagePickerController alloc] init ];
ipc.delegate=self;
ipc.sourceType=UIImagePickerControllerSourceTypeCamera;
//btnUserImage.tag=-2;
[self presentModalViewController:ipc animated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Nemo Rating" message:@"Camera capture is not supported in this device" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
-(void) imagePickerController:(UIImagePickerController *) picker didFinishPickingMediaWithInfo :(NSDictionary *)info
{
UIImage *imageToScale=[info objectForKey:UIImagePickerControllerOriginalImage];
// imageToScale=[imageToScale imageByScalingAndCroppingForSize:CGSizeMake(20,10)];
imageToScale=[imageToScale scaleToSize:CGSizeMake(95, 86)];
[btnUserImage setImage:imageToScale forState:UIControlStateNormal];
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if(version >= 5.0)
{
[[picker presentingViewController] dismissModalViewControllerAnimated:YES];
[picker release];
}
else
{
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
//[picker popViewControllerAnimated:YES];
[picker release];
}
}
は、このコードは、単に私のイメージを与えるが、私はそれを編集することはできませんよ
、その後に私ができるようにする任意の異なるコードがある...次のように
私のコードです編集やフォトアプリ私がfollowinのスクリーンショットをアップロードするより良く理解するために
ように私の画像をトリミング。私は写真アプリからこのスクリーンショットを取る。事前に
感謝。
を助けるかもしれない編集は、Appleが「写真」アプリで提供される機能です。あなたはこれを自分でコードする必要があります – Devang