/BVCropPhoto

Primary LanguageObjective-CGNU General Public License v2.0GPL-2.0

BVCropPhoto

BVCropPhoto is image cropping library for iOS.

System requirements

  • iOS 5.0 or higher

Installation

CocoaPods

pod 'BVCropPhoto'

Usage

    self.cropPhotoView = [[BVCropPhotoView alloc] init];
    self.cropPhotoView.overlayImage = [UIImage imageNamed:@"crop-overlay-568h"];
    self.cropPhotoView.sourceImage = [UIImage imageNamed:@"example1.jpg"];
    self.cropPhotoView.cropSize = CGSizeMake(260, 286);
    [self.view addSubview:self.cropPhotoView];

Get the cropped image

retrieve from view directly

UIImage * croppedImage = self.cropPhotoView.croppedImage;

Example

Init

    DVCropViewController *controller = [[DVCropViewController alloc] init];
    controller.delegate = self;
    controller.sourceImage = [UIImage imageNamed:@"example1.jpg"];
    controller.cropSize = CGSizeMake(260, 286);

Get the cropped image

-(void)cropViewControllerDidCrop:(DVCropViewController *)sender croppedImage:(UIImage *)croppedImage{
    self.imageView.image = croppedImage;
}

License

BVCropPhoto is available under the MIT license. See the LICENSE file for more info.