0
你好,我有模糊圖像的問題..模糊圖像的兩個位圖
我想在一個ImageView的設置模糊的背景和原始圖像..
我嘗試把所有的一個imageview的..現在我梅索德模糊後測試兩個imageviews但它是相同的..
我的代碼
// Then later, when you want to display image
ImageLoader.getInstance().displayImage(listKone.get(i).getCestaObrazok(), imgHorse); // Default options will be used
// ↑ thise method have link where are my image and download image and show it in imgHorse ImageView
imgHorseB=imgHorse;
ImageLoader.getInstance().displayImage(listKone.get(i).getCestaObrazok(), imgHorseB); // Default options will be used
BitmapDrawable drawable = (BitmapDrawable) imgHorseB.getDrawable();
Bitmap bitmap = drawable.getBitmap();
Bitmap blurredBitmap = blur(bitmap);
imgHorseB.setImageBitmap(blurredBitmap);
public Bitmap blur(final Bitmap image) {
if (null == image) return null;
Bitmap outputBitmap = Bitmap.createBitmap(image);
final RenderScript renderScript = RenderScript.create(activity);
Allocation tmpIn = Allocation.createFromBitmap(renderScript, outputBitmap);
Allocation tmpOut = Allocation.createFromBitmap(renderScript, outputBitmap);
//Intrinsic Gausian blur filter
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(renderScript, Element.U8_4(renderScript));
theIntrinsic.setRadius(BLUR_RADIUS);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);
return outputBitmap;
}
有blure圖像中的所有的位圖。如果debbug代碼模糊效果,不過對thise行theIntrinsic.forEach(tmpOut);
在兩個位圖模糊圖像image
和enter code here
我不知道爲什麼..
並完成後thise梅索德模糊圖像是bluredBitmap
和bitmap
但它是錯的..
請幫我