如何正確使用RenderScript Intrinsics。如圖所示http://android-developers.blogspot.com/2013/08/renderscript-intrinsics.htmlRenderScript Intrinsics高斯模糊
//Assuming my original Bitmap is "bm"
Bitmap outputBitmap = Bitmap.createBitmap(bm.getHeight(),
bm.getWidth(), Config.ARGB_8888);
RenderScript rs = RenderScript.create(getApplicationContext());
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur
.create(rs, Element.U8_4(rs));
Allocation tmpIn = Allocation.createFromBitmap(rs, bm);
Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
theIntrinsic.setRadius(25.f);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);
bm.recycle();
rs.destroy
我得到的初始佈局的outputBitmap的一些黑色區域,但
讓用戶滾動HorizontalScrollView的滾輪後填入,使得繪製「刷新」本身。
我得到這個錯誤太(如果它幫助):
09-01 05:54:11.246: E/RenderScript(11423): rsAssert failed: !mElements.size(), in frameworks/rs/rsElement.cpp at 375
關於正確使用RS將幫助任何建議。