RSKImageCropper

https://github.com/ruslanskorb/RSKImageCropper

An image cropper for iOS like in the Contacts app with support for landscape orientation.

一个iOS图片裁剪器,支持横竖屏切换.

Installation - 安装

CocoaPods is the recommended method of installing RSKImageCropper. Simply add the following line to your Podfile:

Podfile

pod 'RSKImageCropper'

Basic Usage - 基本用法

Import the class header.

包含头文件.

#import "RSKImageCropViewController.h"

Just create a view controller for image cropping and set the delegate.

创建一个图片的控制器,并在代理方法中执行裁剪操作.

- (IBAction)onButtonTouch:(UIButton *)sender
{
UIImage *image = [UIImage imageNamed:@"image"];
RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:image];
imageCropVC.delegate = self;
[self.navigationController pushViewController:imageCropVC animated:YES];
}

Delegate - 代理

RSKImageCropViewControllerDelegate provides two delegate methods. To use them, implement the delegate in your view controller.

RSKImageCropViewControllerDelegate提供了两个代理方法.你需要在你的控制器中实现代理方法.

@interface ViewController () <RSKImageCropViewControllerDelegate>

Then implement the delegate functions.

然后,实现代理方法.

// Crop image has been canceled.
- (void)imageCropViewControllerDidCancelCrop:(RSKImageCropViewController *)controller
{
[self.navigationController popViewControllerAnimated:YES];
} // The original image has been cropped.
- (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage
{
self.imageView.image = croppedImage;
[self.navigationController popViewControllerAnimated:YES];
}

Coming Soon - 将要实现的功能

  • Add more cropping guides. 支持更多的裁剪类型
  • If you would like to request a new feature, feel free to raise as an issue. 如果你有着奇葩的想法,你可以提出来哦,亲^_^!

Demo - 应用示例

Build and run the RSKImageCropperExample project in Xcode to see RSKImageCropper in action. Have fun. Fork and send pull requests. Figure out hooks for customization.

编译以及运行RSKImageCropperExample工程,并做交互操作即可.

[翻译] RSKImageCropper的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in E:\\PHP\\wamp\\www\\lsr\\lsr.php on line 42

    类似于这样的错误: 其实大多数的情况下,都是SQL语句书写错了,特别是这种情况: select * from order; 应该写成: select * from `order`;(那不是单引号,而是 ...

  2. nginx 学习笔记(4) Connection处理方法

    nginx支持connection的多种处理方法.nginx运行的平台确定了可用的处理方法. 在特定平台下connection的多种处理方法中,nginx会自动选择一种最有效的方法.然而,如果需要,你 ...

  3. SQLAlchemy之SQL Expression

    SQLAlchemy是一个强大的Python SQL工具箱, 提供了包括ORM在内的各种支持. 首先使用pip安装; pip install SQLAlchemy SQL Expression Lan ...

  4. webbrowser打开新窗口事件+=

    测试可用: private void SaveSnapshot_Click(object sender, EventArgs e) { this.webBrowser1.Navigate(txturl ...

  5. Red Hat Linux 无法使用yum命令

    一:首先提供部分Red Hat 镜像下载地址 1.rhel-server-6.8-i386-dvd.iso 链接: https://pan.baidu.com/s/18VqxRgBMuAJE7Ty0H ...

  6. api.closeFrame

    关闭frame closeFrame({params}) params name: 类型:字符串 默认值:无 描述:(可选项)frame 名字,不传时关闭当前 frame 示例代码 api.close ...

  7. 从数据库表中随机获取N条记录的SQL语句

    Oracle: select * from (select * from tableName order by dbms_random.value) where rownum < N MS SQ ...

  8. Angular待办事项应用4——模拟web服务

    内存服务器 angular提供了一个快速建立测试用的web服务方法,内存服务器(in-memory),让我们不用等待后端开发的进度 安装npm包 npm install --save angular- ...

  9. 点击一个元素,触发另一个元素的click事件

  10. saas模式

    SaaS是Software-as-a-service(软件即服务).SaaS提供商为企业搭建信息化所需要的所有网络基础设施及软件.硬件运作平台,并负责所有前期的实施.后期的维护等一系列服务,企业无需购 ...