Latest 1.1.2
Homepage https://github.com/pionl/IMCropScrollView
License MIT
Platforms ios 5.1, requires ARC
Frameworks UIKit, QuartzCore
Authors

Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

This class supports displaying a image in scrollView with croping option. The user can move the image to desired crop and rotate. For rotation
we use UIImage+Scale with fixOrientation (photos from camera).

You can use in any view, just set the correct frame (in the desired aspect ratio) and after calling croppedImage you will get the desired image.

[[self scrollView] croppedImageWithBlock:^(UIImage *image) {
    [self.preview setImage:image];
}];

You can also draw a overlay over the scrollView and draw image out of the bounds of scroll view

[self.scrollView setClipsToBounds:NO];

[[self cropOverlay] setCropScrollView:[self scrollView]];
[[self cropOverlay] setNeedsDisplay];

The scrollView and overlay can be created from nib or code as needed. The autosize mask doens’t work correctly (future update?).

If you don’t want to use current scrollView, you can only use the cropping option by:

+ (UIImage*)cropImage:(UIImage*)image forScrollViewFrame:(CGRect)frame andZoomScale:(float)zoomScale andContentOffset:(CGPoint)contentOffset andBarColor:(UIColor*)color

Requirements

iOS5+

Installation

IMCropScrollView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'IMCropScrollView', '~> 1.1.1'

Author

Martin Kluska, [email protected]

License

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

Latest podspec

{
    "name": "IMCropScrollView",
    "version": "1.1.2",
    "summary": "IMCropScrollView enables to make scrollView with crop option with rotation. You can also draw a overlay with opacity.",
    "description": "n                        This class supports displaying a image in scrollView with croping option. The user can move the image to desired crop and rotate. For rotationn                        we use UIImage+Scale with fixOrientation (photos from camera).n",
    "homepage": "https://github.com/pionl/IMCropScrollView",
    "license": "MIT",
    "authors": {
        "Martin Kluska": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pionl/IMCropScrollView.git",
        "tag": "1.1.2"
    },
    "social_media_url": "https://twitter.com/pionl",
    "platforms": {
        "ios": "5.1"
    },
    "requires_arc": true,
    "source_files": "IMCropScrollView/*.{h,m}",
    "frameworks": [
        "UIKit",
        "QuartzCore"
    ]
}

Pin It on Pinterest

Share This