-
Blur Image View
about 9 years ago
-
about 9 years ago
For Image blurring you can visit this link.
-
-
about 9 years ago
Use the Following code
private void changeBlur(int value){ Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.background); Bitmap outputBitmap = Bitmap.createBitmap(bmp); final RenderScript rs = RenderScript.create( this ); final Allocation input = Allocation.createFromBitmap( rs, bmp, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT ); final Allocation output = Allocation.createTyped( rs, input.getType() ); final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create( rs, Element.U8_4(rs) ); script.setRadius(value /* e.g. 3.f */); script.setInput(input); script.forEach(output); output.copyTo(outputBitmap); _imageView.setImageBitmap(outputBitmap); }
the value passed to this method will blur the image to that level.
Happy coding :)
-
-
about 9 years ago
Android launch RenderScript Support.
Please check this link:- http://android-developers.blogspot.in/2013/09/renderscript-in-android-support-library.html
http://developer.android.com/guide/topics/renderscript/compute.html -
3 Answer(s)