File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
blurkit/src/main/java/io/alterac/blurkit Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public Bitmap blur(Bitmap src, int radius) {
3939 }
4040
4141 public Bitmap blur (View src , int radius ) {
42- Bitmap bitmap = getBitmapForView (src , FULL_SCALE );
42+ Bitmap bitmap = getBitmapForView (src );
4343 return blur (bitmap , radius );
4444 }
4545
@@ -64,6 +64,19 @@ private Bitmap getBitmapForView(View src, float downscaleFactor) {
6464 return bitmap ;
6565 }
6666
67+ private Bitmap getBitmapForView (View src ) {
68+ Bitmap bitmap = Bitmap .createBitmap (
69+ src .getWidth (),
70+ src .getHeight (),
71+ Bitmap .Config .ARGB_8888
72+ );
73+
74+ Canvas canvas = new Canvas (bitmap );
75+ src .draw (canvas );
76+
77+ return bitmap ;
78+ }
79+
6780 public static BlurKit getInstance () {
6881 if (instance == null ) {
6982 throw new RuntimeException ("BlurKit not initialized!" );
You can’t perform that action at this time.
0 commit comments