当前位置: 首页 > news >正文

[翻译] 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工程,并做交互操作即可.

 

相关文章:

  • 独热编码和dummy编码的作用
  • iOS绘图例2:增加Undo/Redo功能
  • grep简单用法及脚本基础篇
  • SysUtils.UpperCase、SysUtils.LowerCase - 大小写转换
  • 使用X-UA-Compatible来设置IE浏览器兼容模式
  • 区块链技术对未来的影响
  • Delphi 2009 新增的 Class Explorer
  • jar包和war包的区别:
  • 新手须知 C、C++和VC++之间的区别
  • Linux权限、用户以及文本处理的一些相关命令
  • git clone,git push,git pull
  • 对话巨杉核心研发团队:分布式数据库自研之路
  • 用NetHogs监控Linux每个进程的网络使用情况
  • 328
  • 学习Android的一些笔记
  • “寒冬”下的金三银四跳槽季来了,帮你客观分析一下局面
  • php面试题 汇集2
  • Python - 闭包Closure
  • Redis 中的布隆过滤器
  • Spring Boot MyBatis配置多种数据库
  • Vue 2.3、2.4 知识点小结
  • vue-cli3搭建项目
  • 官方解决所有 npm 全局安装权限问题
  • 后端_ThinkPHP5
  • 回顾 Swift 多平台移植进度 #2
  • 记一次和乔布斯合作最难忘的经历
  • 使用前端开发工具包WijmoJS - 创建自定义DropDownTree控件(包含源代码)
  • 写给高年级小学生看的《Bash 指南》
  • 主流的CSS水平和垂直居中技术大全
  • “十年磨一剑”--有赞的HBase平台实践和应用之路 ...
  • MyCAT水平分库
  • postgresql行列转换函数
  • 国内开源镜像站点
  • ​人工智能之父图灵诞辰纪念日,一起来看最受读者欢迎的AI技术好书
  • (1/2)敏捷实践指南 Agile Practice Guide ([美] Project Management institute 著)
  • (DenseNet)Densely Connected Convolutional Networks--Gao Huang
  • (PHP)设置修改 Apache 文件根目录 (Document Root)(转帖)
  • (附源码)ssm旅游企业财务管理系统 毕业设计 102100
  • (转)Android学习笔记 --- android任务栈和启动模式
  • *_zh_CN.properties 国际化资源文件 struts 防乱码等
  • .NET 5种线程安全集合
  • .NET Core 网络数据采集 -- 使用AngleSharp做html解析
  • .net 微服务 服务保护 自动重试 Polly
  • .net专家(高海东的专栏)
  • ??在JSP中,java和JavaScript如何交互?
  • @Async注解的坑,小心
  • @column注解_MyBatis注解开发 -MyBatis(15)
  • @Resource和@Autowired的区别
  • @test注解_Spring 自定义注解你了解过吗?
  • [ 渗透工具篇 ] 一篇文章让你掌握神奇的shuize -- 信息收集自动化工具
  • [BZOJ 4034][HAOI2015]T2 [树链剖分]
  • [BZOJ] 1001: [BeiJing2006]狼抓兔子
  • [C#][DevPress]事件委托的使用
  • [Codeforces1137D]Cooperative Game
  • [EFI]Dell Inspiron 15 5567 电脑 Hackintosh 黑苹果efi引导文件