G
Guest
First of all, I thought this might be a directory security issue but it's not.
I was able to upload the file to the directory via HTTP.
Here's the situation.
I have a JPG file on my server.
..../images/myPIC.jpg
I wanted to draw a box or line using GDI+ on top of myPIC.jpg and then save
the new image to the server.
I was able to draw and display the image on screen but somehow cannot figure
out how to save it to the server.
The code below allows the result to be displayed on screen and it works fine.
newBMP.Save(Response.OutputStream, ImageFormat.Jpeg);
Something else is strange with the above image. When I RIGHT-CLICK and
attempted to save the image, the image cannot be saved. Although it displays
on screen but somehow I cannot copy the image using the RIGHT-CLICK.
Below is the code I used to save the image to the server....
newBMP.Save(Server.MapPath("images/" + "myNewPIC.jpg");
Got the following error:
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder,
EncoderParameters encoderParams) +578
System.Drawing.Image.Save(String filename, ImageFormat format) +59
System.Drawing.Image.Save(String filename) +24
I was able to upload the file to the directory via HTTP.
Here's the situation.
I have a JPG file on my server.
..../images/myPIC.jpg
I wanted to draw a box or line using GDI+ on top of myPIC.jpg and then save
the new image to the server.
I was able to draw and display the image on screen but somehow cannot figure
out how to save it to the server.
The code below allows the result to be displayed on screen and it works fine.
newBMP.Save(Response.OutputStream, ImageFormat.Jpeg);
Something else is strange with the above image. When I RIGHT-CLICK and
attempted to save the image, the image cannot be saved. Although it displays
on screen but somehow I cannot copy the image using the RIGHT-CLICK.
Below is the code I used to save the image to the server....
newBMP.Save(Server.MapPath("images/" + "myNewPIC.jpg");
Got the following error:
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder,
EncoderParameters encoderParams) +578
System.Drawing.Image.Save(String filename, ImageFormat format) +59
System.Drawing.Image.Save(String filename) +24