-3
画像のぼやけた画像を背景に設定したい。画像の表示領域が矩形のようになります。正方形の画像の場合、Backround画像はその画像を保持しませんアスペクト比。 どのようにして矩形領域の背景として二乗画像を設定できますか?画像のblured画像を背景に設定したい
私は
Bitmap outputBitmap = Bitmap.createScaledBitmap(image, image.getWidth(), image.getHeight(),true);
final RenderScript renderScript = RenderScript.create(MyApplication.getContext());
Allocation tmpIn = Allocation.createFromBitmap(renderScript, image);
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);
renderScript.destroy();
スクリーンショットがbelow.I与えられている以下のコードを使用しているぼやけた画像で背景を塗りつぶしたい
は、それがエラーの原因と依存関係になっていない@Abdul Waheed – Nej
を「あなたが目標としているビューのグライドにsettag()を呼び出してはいけません」あなたはグライドのエラーを設定する必要がありますあなたの画像を見るには –
[1]:https://i.stack.imgur.com/CQEuo.pngこれが出力です。背景を記入してください。 @Abdul Waheed – Nej