||07-14-2013 10:06 AM
Image rotate almost working
Found this script online, sort of helps me with my issue but ran into a wall.
Here is the code
public partial class _Default : System.Web.UI.Page
protected void Button1_Click(object sender, EventArgs e)
//get the path to the image
string path = Server.MapPath(Image1.ImageUrl);
//create an image object from the image in that path
System.Drawing.Image img = System.Drawing.Image.FromFile(path);
//rotate the image
//save the image out to the file
//release image file
And the error:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
Line 22: //save the image out to the file
Line 23: img.Save(path);
Line 25: //release image file
And yeah the "path" string is correct and points to the original file.
||07-16-2013 02:30 AM
||07-16-2013 03:16 AM
||07-16-2013 03:18 AM
As a guess, if you want to save it back to the same file, you may need to delete the file after loading it.
Or you could rename it to a dummy name, load from that dummy name, and then save it back to the original name.
But I tell you again: This forum is not the best place to get ASP.NET answers. Try www.asp.net
|All times are GMT +1. The time now is 09:36 PM.
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.