将图像复制到UIPasteboard [英] Copying Images to the UIPasteboard

查看:86
本文介绍了将图像复制到UIPasteboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将图像复制到UIPasteboard?

How can one copy images to the UIPasteboard?

我只看过文字示例。

推荐答案

如果你看一下 Apple的UIPasteboard文档,你看到你可以使用'setImage:`方法将图像复制到粘贴板,例如:

If you look at Apple's Documentation for UIPasteboard, you see that you can use the 'setImage:` method to copy images to the pasteboard, eg:

[[UIPasteboard generalPasteboard] setImage:myImage];

或者如果你想添加多张图片:

or if you want to add multiple images:

[[UIPasteboard generalPasteboard] setImages:[NSArray arrayWithObjects:myFirstImage, mySecondImage, nil]];

或者如果您已有图像数组:

or if you already have the array of images:

[[UIPasteboard generalPasteboard] setImages:myImagesArray];

(所有上述变量以我的应该代替代码中的那些)

(where all the above variables that begin with my should be substituted for the ones in your code)

这篇关于将图像复制到UIPasteboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆