[翻译] RSKImageCropper
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的更多相关文章
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- 【探索】机器指令翻译成 JavaScript
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
- 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...
- 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...
- 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...
- 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?
0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
随机推荐
- Nodejs学习笔记(十二)—定时任务(node-schedule)
写在之前 在实际开发项目中,会遇到很多定时任务的工作.比如:定时导出某些数据.定时发送消息或邮件给用户.定时备份什么类型的文件等等 一般可以写个定时器,来完成相应的需求,在node.js中自已实现也非 ...
- c#中引用类型作为值参数和引用参数问题
一.分类 C#的值类型包括:结构体(数值类型,bool型,用户定义的结构体),枚举,可空类型. C#的引用类型包括:数组,用户定义的类.接口.委托,object,字符串. 二.参数传递 对于引用类型, ...
- sqlserver中调用服务器中的webservice接口
declare @ServiceUrl as varchar(1000) declare @UrlAddress varchar(500)--WebService地址:以http开头,结尾带斜杠,例如 ...
- mybatis在oracle中的分页扩展
applicationContext.xml <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlS ...
- 使用jQuery和CSS3制作数字时钟(jQuery篇) 附源码下载
HTML 和上一篇文章:使用jQuery和CSS3制作数字时钟(CSS3篇)一样的HTML结构,只是多了个>date用来展示日期和星期的. <div id="clock" ...
- jQuery ajax - getJSON() 用法实例
实例 从 test.js 载入 JSON 数据并显示 JSON 数据中一个 name 字段数据: $.getJSON("test.js", function(json){ aler ...
- 什么是SOA
面向服务的架构(SOA)是一个组件模型,它将应用程序的不同功能单元(称为服务)通过这些服务之间定义良好的接口和契约联系起来.接口是采用中立的方式进行定义的,它应该独立于实现服务的硬件平台.操作系统和编 ...
- 【5】Builder模式(构建者模式)
一.引言 在软件系统中,有时需要创建一个复杂对象,并且这个复杂对象由其各部分子对象通过一定的步骤组合而成.例如一个采购系统中,如果需要采购员去采购一批电脑时,在这个实际需求中,电脑就是一个复杂的对象, ...
- apicloud api.openwin
简单介绍api.openWin: 打开window 若window已存在,则会把该window显示到最前面,同时若url有变化或者reload参数为true时,页面会重新加载.若当前正在进行openW ...
- Android开发之旅4:应用程序基础及组件
引言 为了后面的例子做准备,本篇及接下来几篇将介绍Android应用程序的原理及术语,这些也是作为一个Android的开发人员必须要了解,且深刻理解的东西.本篇的主题如下: 1.应用程序基础 2.应用 ...