我看不到对位图所做的更改。任何帮助将不胜感激。
//Get the bitmap
Bitmap originalBitMap = MediaStore.Images.Media.getBitmap(getContext().getContentResolver(), uri);
Bitmap mutuableBitMap = originalBitMap.copy(Bitmap.Config.ARGB_8888, true);
//ZXing
MultiFormatWriter formatWriter = new MultiFormatWriter();
try {
BitMatrix bitMatrix = formatWriter.encode("Hello World", BarcodeFormat.QR_CODE, 200, 200);
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
Bitmap bMapQRCode = barcodeEncoder.createBitmap(bitMatrix);
Canvas canvas = new Canvas(mutuableBitMap);
canvas.drawBitmap(bMapQRCode, mutuableBitMap.getWidth() / 4, 250, new Paint());
} catch (WriterException e) {
e.printStackTrace();
}
//Now I compress the bitmap
mutuableBitMap.compress(Bitmap.CompressFormat.valueOf(extension.toUpperCase()), 90, new FileOutputStream(tempFile));
//And finally set the bitmap to ImageView
imgPicture.setImageBitmap(mutuableBitMap);
在上述之后,图像视图似乎没有对位图所做的更改。当我调试图像时似乎有更改,但是当我将它们设置为Imageview时。我看不到它。任何帮助将不胜感激。