【www.gdgbn.com--元旦图片】


/**////


        /// 按比例缩小图片,自动计算宽度
    ///

        /// 源图文件名(包括路径)
        /// 缩小后保存为文件名(包括路径)
        /// 缩小至高度
        public void SmallPicWidth(string strOldPic, string strNewPic, int intHeight)
        {
            System.Drawing.Bitmap objPic, objNewPic;
            try
            {
                objPic = new System.Drawing.Bitmap(strOldPic);
                int intWidth = (intHeight / objPic.Height) * objPic.Width;
                objNewPic = new System.Drawing.Bitmap(objPic, intWidth, intHeight);
                objNewPic.Save(strNewPic);
            }
            catch (Exception exp) { throw exp; }
            finally
            {
                objPic = null;
                objNewPic = null;
            }
        }
        /**////
  &nbs

本文来源:http://www.gdgbn.com/ps/13013/