空空儿
Don't cry because it came to an end,smile because it happened.
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
posts - 43, comments - 117, trackbacks - 12
<
2006年10月
>
日
一
二
三
四
五
六
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
与我联系
发短消息
搜索
留言簿
(7)
给我留言
查看留言
我参与的团队
武汉.NET俱乐部(0/523)
随笔分类
(53)
AJAX(6)
ASP.NET(14)
C# (9)
DataBase(7)
JAVASCRIPT(14)
O/R Mapping(2)
正则表达式(1)
资源链接
CodeProject
interface
a plugins of jquery
jQuery
stringtemplate
testdriven
最新随笔
1. 在C#里使用属性
2. Read text file (txt, csv, log, tab, fixed length)
3. 批量写数据---将XML数据批量写入数据库
4. 对对象类型和调用方法属性进行存储以提升反射性能
5. 过程 sp_addlinkedsrvlogin,第 91 行解密过程中出错的解决办法
6. 生成大量随机字符串不同实现方式的效率对比
7. 用SQL SERVER 2005新提供的命令实现行列转换
8. APM (异步编程模型)
9. 利用宏让ERStudio生成代码文件
10. 上传文件到FTP
最新评论
1. re: ORACLE 常用函数
多谢:)
--ebreezee
2. re: AJAX TreeView
请楼主也给我发一份
谢谢
233184999@qq.com
--233184999@qq.com
3. re: 让 FireFox 也支持 outerHTML
谢谢
--阿咪
4. re: 让 FireFox 也支持 outerHTML
多谢分享
--nglabc
5. re: AJAX TreeView
楼主能给我发一个AJAX TreeView 的例子吗 ,gyl7789511@126.com
--枫语
阅读排行榜
1. javascript 里Array的一些方法(3701)
2. 使用HtmlParser解析HTML(2795)
3. 生成大量随机字符串不同实现方式的效率对比(2673)
4. 用SQL SERVER 2005新提供的命令实现行列转换(1934)
5. 上传文件到FTP(1775)
评论排行榜
1. AJAX TreeView(26)
2. 在NHibernate里执行存储过程(24)
3. 用SQL SERVER 2005新提供的命令实现行列转换(10)
4. 生成大量随机字符串不同实现方式的效率对比(10)
5. 批量写数据---将XML数据批量写入数据库(9)
C# 生成缩略图
使用C# 生成缩略图,可以进行修改,以实现需要的功能,如图片大小等
1
/**/
///
<summary>
2
///
生成缩略图
3
///
</summary>
4
///
<param name="ImagePath">
大图路径
</param>
5
///
<param name="SavPath">
缩略图保持路径
</param>
6
///
<param name="extention">
图片后缀
</param>
7
///
<param name="ID">图片
ID
</param>
8
public
void
BreviaryImage(
string
ImagePath,
string
SavPath,
string
extention ,
int
ID)
9
{
10
using
(System.Drawing.Image image
=
System.Drawing.Image.FromFile(strPath
+
ImagePath
+
ID
+
extention))
11
{
12
decimal
width
=
image.Width;
13
decimal
height
=
image.Height;
14
int
newwidth,newheight;
15
16
if
(width
>
height)
17
{
18
newwidth
=
100
;
19
newheight
=
(
int
)(height
/
width
*
100
);
20
}
21
else
22
{
23
newheight
=
100
;
24
newwidth
=
(
int
)(width
/
height
*
100
);
25
}
26
27
string
FilePath
=
strPath
+
SavPath;
28
if
(
!
Directory.Exists(FilePath))
29
Directory.CreateDirectory(FilePath);
30
31
using
(System.Drawing.Image aNewImage
=
image.GetThumbnailImage(newwidth,newheight,
null
,IntPtr.Zero))
32
{
33
aNewImage.Save(FilePath
+
ID
+
extention);
34
}
35
}
36
}
posted on 2006-10-31 12:14
空空儿
阅读(219)
评论(0)
编辑
收藏
网摘
所属分类:
C#