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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
博客园 - 【当耐特】
小众软件
小众软件
博客园 - Franky
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
雷峰网
雷峰网
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
云风的 BLOG
云风的 BLOG
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Docker
The Last Watchdog
The Last Watchdog
有赞技术团队
有赞技术团队
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
DataBreaches.Net
S
Security @ Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
TaoSecurity Blog
TaoSecurity Blog
S
Security Affairs
Y
Y Combinator Blog
O
OpenAI News
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
Kaspersky official blog
Cloudbric
Cloudbric

博客园 - 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;
            }
        }