private void btnSavePng_Click(object sender, EventArgs e)
{
// cat.png feather.png Format32bppArgb
string strOldFilePath = @"D:\icon\colorpen.jpg";
string strNewFilePath = @"D:\icon\colorpenNew.png";
Bitmap bmOld = new Bitmap(strOldFilePath);
int iwidth = bmOld.Width;
int iHeight = bmOld.Height;
Bitmap bmNew = new Bitmap(iwidth*2, iHeight*2 ,PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(bmNew))
{
g.DrawImage(bmOld, 0, 0, iwidth, iHeight); //不设置iw,ih可能导致图片变大
}
bmNew.Save(strNewFilePath, bmNew.RawFormat );
}