jberlana/JBCroppableView
关于
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.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文JBCroppableImageView
JBCroppableImageView is a subclass of UIImageView built with UIKit and CoreGraphics that adds n points on an image allowing to modify them by drag & drop to trim the extra space of an image.
Features
- 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.
Installation
- Drag the JBCroppableImageView/JBCroppableLayer files into your project. * Add the CoreGraphics framework to your project.
Usage (see example Xcode project in /TestCroping)
to set up, initialize how you would a reular UIImageView:
-JBCroppableImageView *cropView = [[JBCroppableImageView alloc]
initWithImage:[UIImage imageNamed:”demo”]];
it will be initialized with four crop points. To add or subtract the number of points:
[cropView addPoint];
[cropView removePoint];
to crop the imageView to the requested shape or to revert back to uncropped state:
[cropView crop];
[cropView reverseCrop];
to retrieve the cropped image:
[cropView getCroppedImage];
[cropView getCroppedImageWithTransparentBorder:YES];
*the image property of JBCroppableImageView remains as the original image
Demo

Credit Javier Berlana, Mobile One2One
探索相关项目
加载中…