如何在Android相机应用程序中的相机预览中应用效果(像素化效果)

时间:2017-09-27 10:08:06

标签: android canvas android-camera pixelate

我正在开发Android相机应用程序,我想在我的相机预览中应用这个像素化层?请帮助!

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 个答案:

没有答案