i am using the below code for combining two images.
Bitmap pic = BitmapFactory.decodeResource(getResources(), R.drawable.me);
Bitmap map = BitmapFactory.decodeResource(getResources(), R.drawable.static);
Canvas comboImage = new Canvas(map);
Bitmap out1 = null ;
comboImage.setBitmap(out1);
comboImage.drawBitmap(pic, 600, 350, null);
i am assuming that the i can use the bitmap out1 for getting 开发者_JAVA技巧the final image. but 'comboImage.setBitmap(out1);' line is causing a crash. without this line i am not able to see any images. how can i get the final combined image?
If you want the final image to be out1
, you would do it like this:
Bitmap out1 = Bitmap.createBitmap(...);
Canvas comboImage = new Canvas(out1);
comboImage.drawBitmap(map, ...);
comboImage.drawBitmap(pic, ...);
out1
would then be the merge images
精彩评论