在一个单一的形象多张图片 [英] multiple images in a one single image

查看:126
本文介绍了在一个单一的形象多张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个位图/图像那里有很多的图像,例如拼贴,它在一个单一的画面不止一个图像。

我储存了所有我的图片在网格视图,但现在我想从所有这些图像创建一个图像。连我想拍几张图片可以点击

那么有什么方法可以路线图,以做到这一点?任何形式的帮助/例子会有所帮助。

参考图像

解决方案

 位图PIC1 = BitmapFactory.de codeResource(getResources(),R.drawable.pic1);
    位图PIC2 = BitmapFactory.de codeResource(getResources(),R.drawable.pic2);
    位图BG = BitmapFactory.de codeResource(getResources(),R.drawable.background);
    位图OUT1 = Bitmap.createBitmap(BG);
    帆布comboImage =新的Canvas(OUT1);
    comboImage.drawBitmap(PIC1,10F,20F,NULL);
    comboImage.drawBitmap(PIC2,30F,40F,NULL);
 

OUT1将有PIC1和放大器; PIC2,与背景图像BG。

I want to create a bitmap / image which has many images like "Collage" which has more then one images in a single picture.

I have stored all my images in a grid view but now i want to create a single image from all those images. And even i want to make few images click able

so what can be the road map to do this ? any sort of help / example will be helpful.

reference image

解决方案

    Bitmap pic1 = BitmapFactory.decodeResource(getResources(), R.drawable.pic1);    
    Bitmap pic2 = BitmapFactory.decodeResource(getResources(), R.drawable.pic2);      
    Bitmap bg= BitmapFactory.decodeResource(getResources(), R.drawable.background);
    Bitmap out1 = Bitmap.createBitmap(bg) ;        
    Canvas comboImage = new Canvas(out1);
    comboImage.drawBitmap(pic1, 10f, 20f, null); 
    comboImage.drawBitmap(pic2, 30f, 40f, null); 

out1 will have pic1 & pic2, with a background image bg.

这篇关于在一个单一的形象多张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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