This code for image rotation is simple so we will start step by step.
Step 1) Take an image and button control; code like:
{<form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" Height="178px" Width="247pxImageUrl="~/images/2168NN97_4[1].jpg" /> </div> <asp:Button ID="Button1" runat="server" Text=">>" OnClick="Button1_Click"/>}
Step 2) Double-click on the button and write code as follows:
{protected void Button1_Click(object sender, EventArgs e) { string p = Server.MapPath(Image1.ImageUrl); System.Drawing.Image i = System.Drawing.Image.FromFile(p); i.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipX); i.Save(p); i.Dispose(); Image1.Attributes.Add("ImageUrl",p); }}
Step 3)
Now execute the application and verify that it runs as expected.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: