开发者

how to compose(combine) two photo image in android?

开发者_如何转开发Hello I need to make DRM Image file using two image file. originally I was use bufferedImage class, but android is not support bufferedImage.

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


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 and distanceTop define position of the marker.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜