2016-09-12 9 views
0

開始したものから背景のぼかし効果で開始アクティビティを見ることはできますか?Android。ぼかし効果でアクティビティを開始するには?

たとえば、スターターアクティビティに画像、テキスト、ボタンがある場合は、開始アクティビティ(開始アクティビティレイアウト)によって部分的に隠されている、開始アクティビティ(現在は上部にあります)からそれらをぼかすことができます。暗い透明性も可能ですか?

編集:
私は透明な色を作る方法を知っています。
私は、2つのアクティビティ、つまりスタックの上にあるアクティビティと前のアクティビティの間でこれらの効果を生み出すことができるかどうか尋ねました。

答えて

0

あなたは

public class BlurBuilder { 
    private static final float BITMAP_SCALE = 0.4f; 
    private static final float BLUR_RADIUS = 7.5f; 

    public static Bitmap blur(Context context, Bitmap image) { 
     int width = Math.round(image.getWidth() * BITMAP_SCALE); 
     int height = Math.round(image.getHeight() * BITMAP_SCALE); 

     Bitmap inputBitmap = Bitmap.createScaledBitmap(image, width, height, false); 
     Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap); 

     RenderScript rs = RenderScript.create(context); 
     ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); 
     Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap); 
     Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap); 
     theIntrinsic.setRadius(BLUR_RADIUS); 
     theIntrinsic.setInput(tmpIn); 
     theIntrinsic.forEach(tmpOut); 
     tmpOut.copyTo(outputBitmap); 

     return outputBitmap; 
    } 
} 

は詳細

か、使用できるためthis linkを参照サポート・ライブラリでのrenderScriptが利用可能に使用することができますBlurry

関連する問題