生成二维码 与另外一张图片合并
private Bitmap compoundBitmap(Bitmap bitmapOne,Bitmap bitmapTwo){ Bitmap newBitmap = null; newBitmap=bitmapOne.copy(Bitmap.Config.ARGB_8888, true); // newBitmap = Bitmap.createBitmap(bitmapOne.getWidth(),bitmapOne.getHeight(),bitmapOne.getConfig()); Log.d(TAG, "compoundBitmap: 0"); Canvas canvas = new Canvas(newBitmap); Log.d(TAG, "compoundBitmap: 00"); Paint paint = new Paint(); Log.d(TAG, "compoundBitmap: 1"); int w = bitmapOne.getWidth(); int h = bitmapOne.getHeight(); int w_2 = bitmapTwo.getWidth(); int h_2 = bitmapTwo.getHeight(); Log.d(TAG, "compoundBitmap: 2"); // paint = new Paint(); //设置第二张图片的 左、上的位置坐标 canvas.drawBitmap(bitmapTwo, w-16-w_2, h-24-h_2, paint); canvas.save(); // 存储新合成的图片 canvas.restore(); Log.d(TAG, "compoundBitmap: 3"); return newBitmap; }