简体   繁体   English

合并两个图像(Drawables中的imageOne和相机中的imageTwo)

[英]Merging two Images (imageOne from Drawables & imageTwo from camera)

I am developing an app which uses surface.callback to initialize the front camera when the app is started. 我正在开发一个应用程序,该应用程序在启动时使用surface.callback初始化前置摄像头。 I have done overlayering on the camera and added some buttons along with some funny images. 我在相机上做了覆盖,并添加了一些按钮以及一些有趣的图像。

Now there are three ways to do this as far as my knowledge goes (and I am a newbie so if there's another method that would also be appreciable.) 据我所知,现在有三种方法可以做到这一点(而且我是新手,所以如果还有另一种方法也可以理解的话)。

  • Capture image: The problem is that if I capture the image from camera, I won't get the funny images which are added on the top of the camera preview. 捕获图像:问题是,如果我从相机捕获图像,我将不会获得添加在相机预览顶部的有趣图像。

  • Screenshot: As I have done this through overlayering, hence taking a screenshot through code of a selected portion isn't yielding any result also. 屏幕截图:由于我是通过覆盖层完成的,因此通过选定部分的代码进行屏幕截图也不会产生任何结果。 Because it only takes the screenshot of the layer with 因为它仅使用
    buttons and funny image but not the screenshot of the camera preview as it is behind the layout containing above mentioned items. 按钮和有趣的图像,但不是摄像机预览的屏幕截图,因为它位于包含上述项目的布局后面。

  • Now the only resort is that I merge two images. 现在唯一的办法就是合并两个图像。 One from my drawables folder (funny images) and second obtained at runtime from front camera. 一个来自我的drawables文件夹(有趣的图像),另一个是在运行时从前置摄像头获得的。

Anyone who can kindly help me merge two images. 任何可以帮助我合并两个图像的人。 I have seen some tutorials/codes but they take both images from drawables folder while my second image is obtained at runtime through camera. 我看过一些教程/代码,但是它们同时从drawables文件夹中获取了两个图像,而第二个图像是在运行时通过相机获取的。

您可以捕获相机图像并对其进行编辑(覆盖有趣的图像),然后再将其写入文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM