0

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()
  );
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Omer Arif
  • 31
  • 1
  • I don't think that those effects will work fast enough to make a preview smooth. But in general you need to capture every frame of camera preview, process it with your `Pixelate`, and show of some view. – Vladyslav Matviienko Sep 27 '17 at 10:13
  • Can u suggest some link related about that? – Omer Arif Sep 28 '17 at 05:14
  • just find how to `get bitmap from Camera preview android`, then process that bitmap and do what you find continuously in a separete thread, setting each bitmap into an ImageView for example. This would be a good start, then you can start optimizing code for it to work faster – Vladyslav Matviienko Sep 28 '17 at 07:26

0 Answers0