c# 改变图片大小

 

1 System.Drawing.Bitmap objPic,objNewPic;
2 try
3 {
4   objPic = new System.Drawing.Bitmap(strOldPic);
5   int intHeight=(intWidth / objPic.Width) * objPic.Height;
6   objNewPic=new System.Drawing.Bitmap(objPic,intWidth,intHeight);
7   objNewPic.Save(strNewPic);
8
9 }
10 catch(Exception exp){throw exp;}
11 finally
12 {
13   objPic=null;
14   objNewPic=null;
15 }
16 }
17

 

 


资料来源:学网(www.xue5.com),原文地址:http://www.xue5.com/itedu/200802/109565.html

posted on 2010-11-09 15:52  Jan.David  阅读(742)  评论(0)    收藏  举报

导航