2. The image that is clicked in gridview is displayed in Image control. ...

Posted by Sp under Regular Expressions on 8/19/2010 | Points: 10 | Views : 1481 | Status : [Member] | Replies : 0
I am rotating an image using the following code...........
protected void Button2_Click1(object sender, EventArgs e)
{
string abc = Server.MapPath(Image2.ImageUrl.Replace("/", "\\"));
System.Drawing.Image img = System.Drawing.Image.FromFile(abc);
img.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);

//re-save the picture as a Jpeg
img.Save(abc, System.Drawing.Imaging.ImageFormat.Jpeg);

//tidy up after we've finished
img.Dispose();


}

The rotation does happen but it is overwriting the original image on every click on button .
Scenario:
1. I have a grid showing images.
2. The image that is clicked in gridview is displayed in Image control.
3. Now, i apply rotate function on this image control.
... but what the method mentioned above is doing is that it is overwriting the image and the image displayed in gridview also rotates... I do not want this... Rotation should happen only in Image control for the image that is displayed in it.




Responses

(No response found.)

Login to post response