该死的代码
三聪的博客
 string file = files[i];
                Image img 
= Image.FromFile(file);
                
int width = img.Width;
                
int height = img.Height;
                
if (width > height)
                {
                    width 
= 800;
                    height 
= width * img.Height / img.Width;
                }
                
else
                {
                    height 
= 800;
                    width 
= height * img.Width / img.Height;
                }
                Bitmap bt 
= new Bitmap(width, height);
                Graphics g 
= Graphics.FromImage(bt);
                g.DrawImage(img, 
00, width, height);
                
//g.Save(
                
//Image small = img.GetThumbnailImage(width, height, null, IntPtr.Zero);

                bt.Save(
string.Format("{0}m{1}.jpg", topath, i.ToString("0000")), ImageFormat.Jpeg);
posted on 2011-07-13 14:11  三聪  阅读(209)  评论(0编辑  收藏  举报

作者:gateluck
出处:http://gateluck.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。