第1个回答 推荐于2016-08-16
private void ZhuangHuan(string sourcePath,string desPath)
{
using(Bitmap bitmap=new Bitmap(sourcePath))
{
using(Bitmap newBitmap=bitmap.Clone(new Rectangle(0,0,bitmap.Width,bitmap.Height),PixelFormat.Format24bppRgb))
{
using(Icon icon=Icon.FromHandle(newBitmap.GetHicon()))
{
FileStream fileStream = new FileStream(desPath, System.IO.FileMode.Create);
icon.Save(fileStream);
}
}
}
}