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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
博客园 - 叶小钗
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
S
Security Affairs
Cisco Talos Blog
Cisco Talos Blog
Jina AI
Jina AI
L
LINUX DO - 热门话题
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Secure Thoughts
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
H
Hacker News: Front Page
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
IT之家
IT之家
A
About on SuperTechFans
AWS News Blog
AWS News Blog
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
T
Threatpost
Last Week in AI
Last Week in AI
The Hacker News
The Hacker News
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Security @ Cisco Blogs
Project Zero
Project Zero
N
News | PayPal Newsroom
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
K
Kaspersky official blog
雷峰网
雷峰网
W
WeLiveSecurity
博客园 - 聂微东
D
DataBreaches.Net
博客园 - 司徒正美
V2EX - 技术
V2EX - 技术

博客园 - 三聪

流操作 如何利用.Net内置类,解析未知复杂Json对象 制作等比环切缩缩图 让window.setTimeout等支持带参数方法 利用NewID()生成随机数 winform给html提供接口 IE下记住文本框的光标位置 ie下取得iframe里面内容 短网址计算 树冲突 截图片 学习Objective-C: 入门教程 C#根据字节数截取字符串 asp.net本地和全局资料文件的读取方法 jquery实现点击空白的事件 Asp.net 利用Jquery Ajax传送和接收DataTable 用一个最简单方法解决asp.net页面刷新导致数据的重复提交 SOS"未将对象引用设置到对象的实例" .NET调PHP Web Service的典型例子
创建缩略图
三聪 · 2011-07-13 · via 博客园 - 三聪

 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);