下面这句在Graphics g = Graphics.FromImage(image);这个地方总通不过,请问是怎么回事,谢谢!
string path = Server.MapPath("./" + TextBox1.Text + "\\" + GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text.ToString());
System.Drawing.Image image = System.Drawing.Image.FromFile(path);
System.Drawing.Image copyImage = System.Drawing.Image.FromFile(Server.MapPath("./seal\\sally.jpg"));
Graphics g = Graphics.FromImage(image);
g.DrawImage(copyImage, new Rectangle(image.Width - copyImage.Width, image.Height - copyImage.Height, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
g.Dispose(); string nPath = Server.MapPath("./" + TextBox1.Text + "\\" + GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text.ToString());
image.Save(nPath);
image.Dispose();
if (File.Exists(path))
{
File.Delete(path);
}
Response.Redirect(nPath);
string path = Server.MapPath("./" + TextBox1.Text + "\\" + GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text.ToString());
System.Drawing.Image image = System.Drawing.Image.FromFile(path);
System.Drawing.Image copyImage = System.Drawing.Image.FromFile(Server.MapPath("./seal\\sally.jpg"));
Graphics g = Graphics.FromImage(image);
g.DrawImage(copyImage, new Rectangle(image.Width - copyImage.Width, image.Height - copyImage.Height, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
g.Dispose(); string nPath = Server.MapPath("./" + TextBox1.Text + "\\" + GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text.ToString());
image.Save(nPath);
image.Dispose();
if (File.Exists(path))
{
File.Delete(path);
}
Response.Redirect(nPath);
解决方案 »
- 关于将网页上的GridView中的数据导出一个Excel遇到的问题(解决问题送50分)
- 我想找份。NET工作!
- 共享在线考试系统源码加广告,你也可以不管广告。回复必发。
- 对话框返回值语句如何写?
- 最新完成的.net网站项目,大家评评送分,另外网站上有个问题请教
- 一个RegularExpressionValidator的验证正则表达的奇怪问题
- asp程序向asp.net程序传递session
- 将image对象转换成base64码
- 请教各位!我的页面文件和代码文件在vs.net打不开了,什么原因?
- 一个直接下载excel文件后的问题(zgh_ms([微软] 百变金刚)请进)
- 求一格正则表达式
- 如何webpart一个用户改了布局,所有用户都应用
image是不是null呢?你最好按如下改一下:if (image!=null)
{
Graphics g = Graphics.FromImage(image);
....
}
无法从带有索引像素格式的图像创建 Graphics 对象。