如何将2个图像合并/合并为1个 [英] How to combine/ merge 2 images into 1

查看:130
本文介绍了如何将2个图像合并/合并为1个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道该做什么将2张图片保存到1张图片中。

will like to know who to do save 2 images into 1 image.

其中一张照片允许移动,旋转和放大/缩小...

one of the photo are allow to move, rotate and zoom in/out...

我这样做,但它基本上捕获了屏幕上的所有内容,包括我的按钮......

i'm doing this, but it basically capture all the stuff on the screen including my buttons...

UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *savedImg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();


推荐答案


  1. 创建子视图添加图片。

  2. 在该视图中添加所有图片而不是主视图。

  3. 让按钮和其他内容保留在主视图中。

  4. 只渲染位图上下文中包含图像的视图,而不是像现在这样在主视图中渲染。

  1. crate a subview for adding images.
  2. add all your images in that view instead of the main view.
  3. let the buttons and other stuff stay on the main view.
  4. render only the view with images in the bitmap context instead of the main view like you are doing right now.

这篇关于如何将2个图像合并/合并为1个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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