How to merge multiple UIImageViews into one UIImage(如何将多个 UIImageView 合并为一个 UIImage)
问题描述
我有 2 个 UIImageViews 彼此叠放(图片 + 覆盖框),我想将它们作为 1 张图片保存到相机胶卷中.
I have 2 UIImageViews laying on top of each other ( picture + overlay frame ) and I want to save them to the camera roll as 1 picture.
我应该如何组合这 2 个 UIImageView,以便我可以使用结果"UIImage 调用 UIImageWriteToSavedPhotosAlbum 函数?
How should I combine those 2 UIImageViews so that I can call the UIImageWriteToSavedPhotosAlbum function, using a 'result' UIImage?
推荐答案
我现在附近没有我的 Mac,但我以前做过.该过程是您将 UIImageView
渲染到位图上下文中,然后从该上下文创建一个 CGImage
,您可以使用它来创建一个新的 UIImage代码>来自.阅读
CGBitmapContext
,包括 CGBitmapContextCreateImage
I don't have my Mac nearby at the moment, but I have done this before.
The process is that you'll render the UIImageView
s into a bitmap context, then create a CGImage
from that context that you can use to create a new UIImage
from.
Read up on CGBitmapContext
, including CGBitmapContextCreateImage
这篇关于如何将多个 UIImageView 合并为一个 UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将多个 UIImageView 合并为一个 UIImage


- android 4中的android RadioButton问题 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01