生成水印的过程。其实分为三个环节:第一,载入原始图片;第二,载入水印图片;第三,保存新的图片。
- *
- * private Bitmap createBitmap( Bitmap src, Bitmap watermark )
- * {
- * String tag = "createBitmap";
- * Log.d( tag, "create a new bitmap" );
- * if( src == null )
- * {
- * return null;
- * }
- *
- * int w = src.getWidth();
- * int h = src.getHeight();
- * int ww = watermark.getWidth();
- * int wh = watermark.getHeight();
- *
- * Bitmap newb = Bitmap.createBitmap( w, h, Config.ARGB_8888 );
- * Canvas cv = new Canvas( newb );
- *
- * cv.drawBitmap( src, 0, 0, null );
- *
- * cv.drawBitmap( watermark, w - ww + 5, h - wh + 5, null );
- *
- * cv.save( Canvas.ALL_SAVE_FLAG );
- *
- * cv.restore();
- * return newb;
- * }
图片水印的生成方法
原文:http://www.cnblogs.com/visuals/p/4819107.html