在一个单一的形象多张图片多张、形象、图片

2023-09-05 11:22:33 作者:菇凉、你只需哭不允许输

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

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

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

参考图像的

解决方案

 位图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.

搞笑图片008期 妹子你这是啥意思呢,想乘风破浪的飞起来了吗

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.