如何通过合并两个图像创建新的图像 [英] How Create a new Image by merging two images

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

问题描述

我要创建一个从两个不同的图像.OUTPUT映像必须产生一个新的形象
从通过拖动覆盖在其他图像单张图像,放大/缩小,旋转动作。

I want to Create a new image from two different Images .Output image must be result from overlaying one Image on other image by using drag ,zoom in/out, rotate actions.

我是新来的Andr​​oid我怎么能做到这一点。其中查看我需要使用
surfaceview / ImageView的????

I am new to Android how can i do that. which view i need to use surfaceview/imageview ????

感谢您的时间。

推荐答案

,如果你想这样做动态(响应用户操作)的不明确或者是否要基于特定的拖/变焦,生成固定图像/旋转参数。对于前者,你应该有一个自定义视图,在那里你可以做你自己的所有图形中的的onDraw去()。对于后者,你可以用Bitmap类做到这一点。你不需要任何的意见。请按照下列步骤:

It's not clear if you want to do this dynamically (in response to user actions) or whether you want to generate a fixed image based on specified drag/zoom/rotate parameters. For the former, you should go with a custom View, where you can do all your own drawing in onDraw(). For the latter, you can do this with the Bitmap class. You don't need any views. Follow these steps:


  1. 创建所需大小的目标位图。

  2. 创建一个画布,传递目标位图的构造。这将创建一个画布,将吸引到目标位图。

  3. 绘制创建一个画图对象。

  4. 使用Canvas绘制你的第一个源图像。

  5. 应用适当的转换来画图对象后绘制覆盖图像。

之后,您可以使用位图在接受图像的ImageView的或其他视图类(如TextView的)。

Later, you can use the Bitmap in an ImageView or other view class that accepts images (e.g., TextView).

这篇关于如何通过合并两个图像创建新的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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