+ private Bitmap handlePNG(Bitmap bitmap, int px){
+ Bitmap resultBitmap = Bitmap.createBitmap(px,
+ px,
+ Bitmap.Config.ARGB_8888);
+ Canvas c = new Canvas(resultBitmap);
+ Bitmap checker = BitmapFactory.decodeResource(MainApp.getAppContext().getResources(),
+ R.drawable.checker_16_16);
+
+ BitmapDrawable background;
+ background = new BitmapDrawable(MainApp.getAppContext().getResources(), checker);
+
+ background.setBounds(0, 0, px, px);
+ background.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
+ background.draw(c);
+
+ c.drawBitmap(bitmap, 0, 0, null);
+
+ return resultBitmap;
+ }
+