如何组合(组合)两个光电图像中的android? [英] how to compose(combine) two photo image in android?

查看:76
本文介绍了如何组合(组合)两个光电图像中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好 我需要使用两个图像文件DRM图像文件。 原本我是使用BufferedImage类,但是Android不支持的BufferedImage。

Hello I need to make DRM Image file using two image file. originally I was use bufferedImage class, but android is not support bufferedImage.

所以请帮助我。如何组合两个图像中的android?

so please help me. how to compose two image in android?

推荐答案

您可以做,如果你将两张图像。假设BMP1是更大的一个(被保护),和BMP2的标记:

You can do that if you overlay two images. Suppose that bmp1 is bigger one (to be protected), and bmp2 is marker:

private Bitmap overlayMark(Bitmap bmp1, Bitmap bmp2) 
{ 
    Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig()); 
    Canvas canvas = new Canvas(bmOverlay); 
    canvas.drawBitmap(bmp1, 0, 0, null);
    canvas.drawBitmap(bmp2, distanceLeft, distanceTop, null);
    return bmOverlay; 
} 

distanceLeft distanceTop 定义标记的位置。

distanceLeft and distanceTop define position of the marker.

这篇关于如何组合(组合)两个光电图像中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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