Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help rotating image and displaying in <asp:Image />

Status
Not open for further replies.

aspdotnetuser

Programmer
Oct 10, 2008
45
GB
Hi,

I want to allow the user to click a button which gets an image from the specified path and rotates it. I have the code working but I don't know how to display the rotated image.

The code I have at the moment gets the image from a local path on C:\ and rotates it and then saves the image again. However, the <asp:Image /> control doesn't seem to be able to read the local path and can only read from the server, and the image doesn't save to the server path so how can I display the image in the image control?

[blue]Bitmap bitmap1;

bitmap1 = (Bitmap)Bitmap.FromFile(@"C:\TestPic.bmp");

PictureBox PictureBox1 = new PictureBox();

PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;

PictureBox1.Image = bitmap1;

PictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipNone);

bitmap1.Save(@"C:\TestPic.bmp");

Image1.ImageUrl = @"C:\TestPic.bmp";[/blue]
 
I found out how to do this, it was because the path it was saving to was different.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top