JBCroppableView is a subclass of UIView built with UIKit and CoreGraphics that adds n points on an UIImageView allowing to modify them by drag & drop to trim the extra space of an image.
- Add an NSArray of specific CGPoints to a UIImageView.
- Add a specific number of points.
- Drag&Drop of the points.
- Crops the UIImage in a UIImageView.
- Respects aspect ratio.
- ARC(Automatic Reference Counting) support.
- Drag the JBCroppableView/JBCroppableView folder into your project.
- Add the CoreGraphics framework to your project.
(see example Xcode project in /TestCroping)
self.pointsView = [[JBCroppableView alloc] initWithImageView:self.image];
[self.pointsView addPoints:9];
[self.view addSubview:self.pointsView];
self.pointsView = [[JBCroppableView alloc] initWithImageView:self.image];
[self.pointsView addPointsAt:@[[NSValue valueWithCGPoint:CGPointMake(10, 10)],
[NSValue valueWithCGPoint:CGPointMake(50, 10)],
[NSValue valueWithCGPoint:CGPointMake(50, 50)],
[NSValue valueWithCGPoint:CGPointMake(10, 50)]]];
[self.view addSubview:self.pointsView];
- (NSArray *)getPoints;
- (UIImage *)deleteBackgroundOfImage:(UIImageView *)image;
Javier Berlana, Mobile One2One