Rotate Image

looking for simple way to rotate an image (tif file usually) using vb.net.
I am playing with RotateFlip and that I dont think is what I am looking for... not saving a file that will open up.

Any help you can give me is appreciated.
LVL 1
NTGuru705Asked:
Who is Participating?
 
unassassinableConnect With a Mentor Commented:
Here is a walkthrough on rotating an image around its center in .net:

http://jelle.druyts.net/2004/05/26/RotatingAnImageAroundItsCenterInNET.aspx

Also, here is an example of rotating or flipping an image from a file:

''' <summary>
''' Rotates and/or flips an image from a file.
''' </summary>
''' <param name="imgPath">The path of the image you'd like to flip.</param>
''' <param name="savePath">The path of the flipped image you'd like to save to.</param>
''' <param name="rotFlipType">The RotateFlipType enum to flip or rotate the image.</param>
''' <param name="imgFormat">The format to save the file to.</param>
''' <remarks></remarks>

Public Sub rotFlipImageFromFile(ByRef imgPath As String, ByRef savePath As String, _
ByRef rotFlipType As RotateFlipType, ByRef imgFormat As System.Drawing.Imaging.ImageFormat)
    Dim img As System.Drawing.Image
    img = System.Drawing.Bitmap.FromFile(imgPath)
    img.RotateFlip(rotFlipType)
    ' We delete the file if it exists so it doesn't fail.
    If System.IO.File.Exists(savePath) Then System.IO.File.Delete(savePath)
    img.Save(savePath, imgFormat)
End Sub

' Example usage of the snippet:
rotFlipImageFromFile("c:\lol.gif", "c:\lol.gif", RotateFlipType.RotateNoneFlipXY, _
Imaging.ImageFormat.Gif)
0
 
Fernando SotoRetiredCommented:
What exactly do you want to accomplish?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.