0

I use the following code to square a bitmap that is rectangular :

private static Bitmap squareBitMap(Bitmap givenBitmap) {
        int dim = Math.max(givenBitmap.getWidth(), givenBitmap.getHeight());
        Bitmap resultBitmap= Bitmap.createBitmap(dim, dim, Config.ARGB_8888);

        Canvas canvas = new Canvas(resultBitmap);
        canvas.drawColor(Color.WHITE);


        canvas.drawBitmap(givenBitmap, (dim - givenBitmap.getWidth()) / 2, (dim - givenBitmap.getHeight()) / 2, null);

        return resultBitmap;
    }

And this code to blur a bitmap.

There are many apps in google play that blur and square bitmap like that:

EXAMPLE

enter image description here

how can i achieve that?

Community
  • 1
  • 1
Device
  • 993
  • 3
  • 11
  • 26
  • possible duplicate of [Fast Bitmap Blur For Android SDK](http://stackoverflow.com/questions/2067955/fast-bitmap-blur-for-android-sdk) – Viktor Yakunin Aug 03 '15 at 11:35
  • Check http://chiuki.github.io/android-shaders-filters/#/43. I didn't try but it could be a good point to start from ;) – Gordak Aug 03 '15 at 11:36

0 Answers0