| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 863 人关注过本帖
标题:[求助]各位大哥: 加颜色的这句编译后:Parameter is not valid.请问如何修改 ...
只看楼主 加入收藏
fanbin0810
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-12
收藏
 问题点数:0 回复次数:3 
[求助]各位大哥: 加颜色的这句编译后:Parameter is not valid.请问如何修改?谢谢!
protected void UpdateBtn_Click(object sender, EventArgs e)
{
String filename1;
filename1=Image1.Src;
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(filename1));
System.Drawing.Image newimage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppRgb);
Graphics g = Graphics.FromImage(newimage);
g.DrawImage(image,0,0,image.Width,image.Height);
Font f = new Font(FontType.SelectedItem.Text, Int32.Parse(FontSize.SelectedItem.Text));
Brush b = new SolidBrush(Color.Red);
g.DrawString(Caption.Text, f, b, 10, 140);
g.Dispose();
System.Drawing.Image suo = Bitmap.FromFile(Server.MapPath(filename1));
suo = suo.GetThumbnailImage(Int32.Parse(Width.Text), Int32.Parse(Height.Text), null, IntPtr.Zero);
image.Dispose();
image.Save(Server.MapPath(filename1), ImageFormat.Jpeg);
Image1.Src=filename1;
Caption.Text="";

}

各位大哥: 加颜色的这句编译后:Parameter is not valid.请问如何修改?谢谢!!急啊
搜索更多相关主题的帖子: Parameter valid not image Drawing 
2006-04-20 08:29
小笨笨
Rank: 5Rank: 5
等 级:贵宾
威 望:19
帖 子:1169
专家分:0
注 册:2006-4-17
收藏
得分:0 

先image.Dispose();
image.Save(Server.MapPath(filename1), ImageFormat.Jpeg);??

有没有搞错,都已经dispose了,还怎么save啊?


欢迎光临我的博客: http://smallfools.blog./default.html
2006-04-20 08:50
fanbin0810
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-12
收藏
得分:0 

我也是刚学,不懂啊!

2006-04-20 08:57
fanbin0810
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-12
收藏
得分:0 
你有在上传图片以后加水印的程序吗?急用啊
2006-04-20 09:00
快速回复:[求助]各位大哥: 加颜色的这句编译后:Parameter is not valid.请问如 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022269 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved