/// <summary>
/// 修改图片画布大小(图像不变),增加文字水印
/// </summary>
/// <paramname="bmp"> 图片 </param>
/// <paramname="newW"> 图片宽度 </param>
/// <paramname="newH"> 图片高度 </param>
public static void KiResizeImage(Bitmapbmp, int newW, int newH)
{
try
{
Bitmapb = new Bitmap(newW,newH);
Graphicsg = Graphics.FromImage(b);
g.DrawImage(bmp, new Rectangle( 0 , 0 ,newW,newH), new Rectangle( 0 , 0 ,newW,newH + 20 ),GraphicsUnit.Pixel);
Fontf = new Font( " f " , 10 );
Brushbru = new SolidBrush(Color.Red);
string addtext = " 文字 " ;
g.DrawString(addtext,f,bru, 20 ,newH - 20 );
g.Dispose();
b.Save( " F:/a.jpg " );
}
catch {}
}
#endregion