日期:2014-05-18  浏览次数:20489 次

高手请进,顶者有分. asp 请求 c# dll 问题
dll   类代码

                ///   缩略图
                  public   static   byte[]   GetThumbnail(byte[]   img,   int   width,   int   height,   string   mode)
                {
                        System.IO.MemoryStream   ms   =   new   System.IO.MemoryStream(img);
                        Image   originalImage   =   System.Drawing.Image.FromStream(ms);

                        int   towidth   =   width;
                        int   toheight   =   height;

                        int   x   =   0;
                        int   y   =   0;
                        int   ow   =   originalImage.Width;
                        int   oh   =   originalImage.Height;
                        Image   bitmap;
                        if   (ow   >   towidth   ||   oh   >   toheight)
                        {
                                switch   (mode)
                                {
                                        case   "HW "://指定高宽缩放(可能变形)                                
                                                break;
                                        case   "W "://指定宽,高按比例                                        
                                                toheight   =   originalImage.Height   *   width   /   originalImage.Width;
                                                break;
                                    &nb