logo  Rotate and Flip Images
This Chapter
Convert Graphics
Image Attribute
Special Effects
Picture Boxes
Rotate & Flip
Chapters
Home Page
Colours, RGB
Computer Specifications
Dates&Times
Disk Drives
Files
Folders
GPS and OS Ref
VB.Net Forms
Image Files
If & Select
List/Array
Mathematics
NuGet
Sound
String Functions
Sun and Moon
User Controls
Validation
DigitalDan Sites
My Other Sites
Contact Site

Note
Some pages
may contain
inaccuracies
Hits=5
VB.Net has built in functions to rotate and/or flip images in a single line of code. The images with each sample function indicate what happens to a map of the UK when subjected to the flip/rotate being described. Every function is based on this image
Normal map of the UK
Map of UK before Rotate/Flip action
Rotated 90
Rotate 90 Degrees

Private Function Rotate90(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
 Return bmp
End Function
      
Rotated 180
Rotate 180 Degrees

Private Function Rotate180(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.Rotate180FlipNone)
 Return bmp
End Function
      
Rotated 270
Rotate 270 Degrees

Private Function Rotate270(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.Rotate270FlipNone)
 Return bmp
End Function
      
Flipped Horizontal
Flip Horizontal

Private Function FlipH(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.RotateNoneFlipX)
 Return bmp
End Function
      
Flipped Vertical
Flip Vertical

Private Function FlipV(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.RotateNoneFlipY)
 Return bmp
End Function
      
Rotated 90 and Flipped Vertical
Rotate 90 and Flip Vertical

Private Function Rotate90andFlipV(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.Rotate90FlipY)
 Return bmp
End Function
      
Rotated 90 and Flipped Horizontal
Rotate 90 and Flip Horizontal

Private Function Rotate90andFlipH(bmp As Bitmap) As Bitmap
 bmp.RotateFlip(RotateFlipType.Rotate90FlipX)
 Return bmp
End Function
      

 
Other Rotate Flips
"RotateNoneFlipNone" and "Rotate180FlipXY" = do nothing
Other rotate flips have direct equivilents in the above list.

DigitalDan.co.uk