views:

551

answers:

1

Hi,

In my application I m using UIImagePickerControllerCropRect to crop the image but I want to reduce the size of that cropping box of iphone which comes automatically so that my image crop to its perfect size which I want.I m using the following code for that:--

-(IBAction) getPhoto:(id) sender {
    UIImagePickerController * picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;

    if((UIButton *) sender == choosePhotoBtn) {
        picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
        picker.allowsImageEditing = YES;
    } else {
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    }

    [self presentModalViewController:picker animated:YES];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
    [picker dismissModalViewControllerAnimated:YES];

    imageView.image = image;
    CGSize size = [imageView.image size];
    CGRect cropRect = CGRectMake(0.0, 0.0, size.width, size.height);
    NSLog(@"Original image size = (%f, %f)", size.width, size.height);

    NSValue *cropRectValue = [editingInfo objectForKey:@"UIImagePickerControllerCropRect"];
    cropRect = [cropRectValue CGRectValue];
    UIImageWriteToSavedPhotosAlbum(imageView.image, self, nil, nil);
} 

Please help me out?

Its urgent, Thanks in Advance

A: 

better late then never! Check this post http://iphoneincubator.com/blog/tag/uiimagewritetosavedphotosalbum

mkapras