Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/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.
https://github.com/jberlana/JBCroppableView
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/jberlana/JBCroppableView
- Owner: jberlana
- Created: 2012-12-28T11:40:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-05T09:28:48.000Z (about 11 years ago)
- Last Synced: 2023-10-20T20:41:45.351Z (over 1 year ago)
- Language: Objective-C
- Size: 571 KB
- Stars: 354
- Watchers: 33
- Forks: 91
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - 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. (etc)
- awesome - 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. (etc)
README
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
----![image]()
Credit Javier Berlana, [Mobile One2One]()
---------------------------------------------------------------