我看同事使用JAVA调用AP使用imagemagick生成缩略图而且很清楚,在C#中怎么使用啊?
解决方案 »
- 40分啦,,,简单问题
- 有偿寻求asp.net整合ucenter
- 根据dropdownlist选择的item,再加上搜索框的Text,决定gridview的搜索结果
- 苹果 谷歌浏览器下 自定义鼠标样式兼容问题
- 大家帮我看看,关于权限的问题。
- 一个小问题:DropDownList绑定 的问题!
- 创建maste页后contentplaceholder不能改变大小位置
- 解决问题就给分
- 怎么给TreeView 加事件来实现被选择项,直接获取到值;
- 怎么办?怎么办?怎么办?怎么办?怎么办?
- 如何在GridView分页行里面增加实现当前第几页,总共几页
- 关于翻页广告如何通过绑定数据库改变所显示图片的问题(高分!!急!!在线等)
{
protected void Page_Load(object sender, EventArgs e)
{
Stream s = File.Open(Server.MapPath("~/")+ "/s_3.gif", FileMode.Open, FileAccess.Read, FileShare.None);
byte[] b = new byte[(int)s.Length];
s.Read(b, 0, (int)s.Length); Response.OutputStream.Write(b, 0, (int)s.Length);
s.Close(); } protected void Button1_Click1(object sender, EventArgs e)
{
if (File1.PostedFile.FileName != null)
{
string namestr = Path.GetFileName(File1.PostedFile.FileName);//提取文件名
File1.PostedFile.SaveAs(Server.MapPath(".") + @"\" + namestr);
Image2.Visible = true;
Image2.ImageUrl = namestr;
System.Drawing.Image image, aNewImage;
image = System.Drawing.Image.FromStream(File1.PostedFile.InputStream);
decimal width = image.Width;
decimal height = image.Height;
int newwidth, newheight;
if (width > height)
{
newwidth = 150;
newheight = (int)(height / width * 150);
}
else
{
newheight = 150;
newwidth = (int)(width / height * 150);
}
aNewImage = image.GetThumbnailImage(newwidth, newheight, null, IntPtr.Zero);
Bitmap output = new Bitmap(aNewImage);
Graphics g = Graphics.FromImage(output);
g.DrawString("LonoL", new Font("Courier New", 9), new SolidBrush(Color.Red), 60, 60);//写版权信息及文本格式及位置
output.Save(Server.MapPath("~/") + @"\s_" + namestr, System.Drawing.Imaging.ImageFormat.Jpeg);
Image1.Visible = true;
Image1.ImageUrl = "s_" + namestr;
}
else
{
Response.Write("B");
}
}
}
using System.Drawing.Imaging;
using System.IO;
需要被引用的