惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - Ame

将项目改为windows 服务的步骤 js 设为首页,加入收藏夹 - Ame - 博客园 FCKeditor 的使用心得 IE,firefox 里对浏览器事件处理的兼容性处理 - Ame - 博客园 项目中的JS ,alert 出现乱码 Jquery 插件参考 报表实现的参考 RDLC 矩阵使用 - Ame - 博客园 ajaxpro 的使用心得 - Ame - 博客园 [转]ReportViewer 2008的部署 Reporting services 权限 经典正则表达式 [转载] iframe和跨站点cookie被阻止 (转载) js 动态生成HTML,并加载事件遇到的问题 - Ame - 博客园 jquery.cookies 的使用心得[仅做自己记忆所用] 一些药物的副作用 一些食物的用法 Blogs Flog Fat 蜂蜜知识大全 - Ame - 博客园
压缩图片 - Ame - 博客园
Ame · 2010-06-29 · via 博客园 - Ame

 public void CreateThumbnailImage() 

 { 

     string imgFile = "e:/test.jpg"; 

     System.Drawing.Image img = System.Drawing.Image.FromFile(imgFile); 

     System.Drawing.Image.GetThumbnailImageAbort cb = new System.Drawing.Image.GetThumbnailImageAbort(CallBack); 

     System.Drawing.Image thumbnailImage = img.GetThumbnailImage(120, 120, cb, System.IntPtr.Zero); 

     string extendName = imgFile.Substring(imgFile.LastIndexOf(".") + 1); 

     ImageFormat imgFormat = GetImageFormat(extendName); 

     thumbnailImage.Save("e:/result.jpg",imgFormat); 

 } 

 public bool CallBack() 

 { 

     return     false; 

 }

 //获得图片格式 

        private static ImageFormat GetImageFormat(String extendName)
        {
            extendName = extendName.ToLower();
            switch (extendName)
            {
                case "gif":
                    return ImageFormat.Gif;
                case "jpg":
                case "jpeg":
                    return ImageFormat.Jpeg;
                case "bmp":
                    return ImageFormat.Bmp;
                case "wmf":
                    return ImageFormat.Emf;
                case "exif":
                    return ImageFormat.Exif;
                case "icon":
                    return ImageFormat.Icon;
                case "tiff":
                    return ImageFormat.Tiff;
                default:
                    return ImageFormat.Png;
            }
        }