how to apply effect (Pixelate effect) in camera preview in android camera application

127 Views Asked by At

I'm working on android camera application and I want to apply this pixelate layer in my camera preview?? Kindly help!

bitmap = Pixelate.fromAsset(
          getAssets(), "a3.png",
          new PixelateLayer.Builder(PixelateLayer.Shape.Square)
                 .setResolution(32)
                 .build(),
          new PixelateLayer.Builder(PixelateLayer.Shape.Circle)
                 .setResolution(32)
                 .setOffset(15)
                 .build(),
          new PixelateLayer.Builder(PixelateLayer.Shape.Circle)
                 .setResolution(32)
                 .setSize(26)
                 .setOffset(13)
                 .build(), 
          new PixelateLayer.Builder(PixelateLayer.Shape.Circle)
                 .setResolution(32)
                 .setSize(18)
                 .setOffset(10)
                 .build(),
          new PixelateLayer.Builder(PixelateLayer.Shape.Circle)
                 .setResolution(32)
                 .setSize(12)
                 .setOffset(8)
                 .build()
  );
0

There are 0 best solutions below