Giter Site home page Giter Site logo

edgency / jbcroppableview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jberlana/jbcroppableview

0.0 2.0 0.0 585 KB

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.

jbcroppableview's Introduction

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

jbcroppableview's People

Contributors

jberlana avatar daniel-sanche avatar

Watchers

James Cloos avatar edgency avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.