Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

 3 Answer(s)

  • 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 :)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: