How to make an Image Rotator
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
9 posts
Page 1 of 1
Hello everyone,
Here is another tutorial that I am posting today. This tutorial shows how to make an image rotator that has like 16 rotation types (all the rotations that the system/vb.net supports). You can load an image, rotate it and then save it while keeping the rotation. Please don't post negative/disappointing comments.
---------------------------------------------------------------------------
First of all, open Visual Basic 2008, create a new project, choose Windows Forms Application, type in the textbox Image Rotator and press the OK button. As soon as you have done this, the Form1 will appear on the screen on which we will design our application and code it.
First we will do the designing and then the coding. So now we will change the Form1's properties to make it look good. Change the Form1's Text property to Image Rotator. Change it's StartPosition property to CenterScreen. Change it's FormBorderStyle to FixedSingle. Change it's MaximizeBox property to False. Change it's Size property to 500, 350 or whatever you like, no restrictions!
Now add the following things to the form:
(1)_ 1 PictureBox. Change it's SizeMode property to Zoom. Change it's BorderStyle property to FixedSingle.
(2)_ 3 Buttons. Change Button1's Text property to Open, Button2's to Save and Button3's to Rotate.
(3)_ 1 ComboBox. Add the following items to it by clicking on its Items property and then click on the "..." button. Here are the items:
Now is the time to code Form1 and it's components. So right-click on the form in the Solution Explorer and click View Code.
Type the following code before Public Class Form1:
Well, that's all. It was real easy, wasn't it?
---------------------------------------------------------------------------
Voila! You have just completed making an Image Rotator rotates the image that you provide by 16 rotation types. Now debug and run it by pressing the Start Debugging button located at the main toolstrip. Test it, if it works fine then its SAVING time. You can save your project by going to File -> Save All and then pressing Save.
And there! You have your project and application that works. If you have any problem or can't understand something, please feel free to ask by either a comment or by PM. I have also attached a screenshot.
Please use the Give Thanks button and the Reputation System to appreciate my hard work. I have wrote this tutorial while making an Image Rotator project myself so you can download the source file in the attachments.
Thank you.
![Image]()
Here is another tutorial that I am posting today. This tutorial shows how to make an image rotator that has like 16 rotation types (all the rotations that the system/vb.net supports). You can load an image, rotate it and then save it while keeping the rotation. Please don't post negative/disappointing comments.
---------------------------------------------------------------------------
First of all, open Visual Basic 2008, create a new project, choose Windows Forms Application, type in the textbox Image Rotator and press the OK button. As soon as you have done this, the Form1 will appear on the screen on which we will design our application and code it.
First we will do the designing and then the coding. So now we will change the Form1's properties to make it look good. Change the Form1's Text property to Image Rotator. Change it's StartPosition property to CenterScreen. Change it's FormBorderStyle to FixedSingle. Change it's MaximizeBox property to False. Change it's Size property to 500, 350 or whatever you like, no restrictions!
Now add the following things to the form:
(1)_ 1 PictureBox. Change it's SizeMode property to Zoom. Change it's BorderStyle property to FixedSingle.
(2)_ 3 Buttons. Change Button1's Text property to Open, Button2's to Save and Button3's to Rotate.
(3)_ 1 ComboBox. Add the following items to it by clicking on its Items property and then click on the "..." button. Here are the items:
Code: Select all
Rotate180FlipNone
Rotate180FlipX
Rotate180FlipXY
Rotate180FlipY
Rotate270FlipNone
Rotate270FlipX
Rotate270FlipXY
Rotate270FlipY
Rotate90FlipNone
Rotate90FlipX
Rotate90FlipXY
Rotate90FlipY
RotateNoneFlipNone
RotateNoneFlipX
RotateNoneFlipXY
RotateNoneFlipY
Now is the time to code Form1 and it's components. So right-click on the form in the Solution Explorer and click View Code.
Type the following code before Public Class Form1:
Code: Select all
Write the following code by double-clicking Button1 whose Text property was Open:
Imports System.Drawing.Imaging
Code: Select all
Write the following code by double-clicking Button2 whose Text property was Save:
Dim opendlg As OpenFileDialog = New OpenFileDialog()
opendlg.Title = "Select the image to open."
opendlg.Filter = ("Supported Image Files|*.gif;*.jpg;*.bmp;*.png")
opendlg.ShowDialog()
Dim Image As Image = New Bitmap(opendlg.FileName)
PictureBox1.Image = Image
Code: Select all
Write the following code by double-clicking Button3 whose Text property was Rotate:
Dim savedlg As New SaveFileDialog
savedlg.Title = "Select the filename to save the image."
savedlg.Filter = ("Supported Image Files|*.gif;*.jpg;*.bmp;*.png")
Dim pic As Image
pic = PictureBox1.Image
savedlg.ShowDialog()
pic.Save(savedlg.FileName)
Code: Select all
Dim rotateImage As Image = New Bitmap(PictureBox1.Image)
If ComboBox1.Text = "Rotate180FlipNone" Then
rotateImage.RotateFlip(RotateFlipType.Rotate180FlipNone)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate180FlipX" Then
rotateImage.RotateFlip(RotateFlipType.Rotate180FlipX)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate180FlipXY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate180FlipXY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate180FlipY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate180FlipY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate270FlipNone" Then
rotateImage.RotateFlip(RotateFlipType.Rotate270FlipNone)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate270FlipX" Then
rotateImage.RotateFlip(RotateFlipType.Rotate270FlipX)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate270FlipXY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate270FlipXY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate270FlipY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate270FlipY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate90FlipNone" Then
rotateImage.RotateFlip(RotateFlipType.Rotate90FlipNone)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate90FlipX" Then
rotateImage.RotateFlip(RotateFlipType.Rotate90FlipX)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate90FlipXY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate90FlipXY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "Rotate90FlipY" Then
rotateImage.RotateFlip(RotateFlipType.Rotate90FlipY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "RotateNoneFlipNone" Then
rotateImage.RotateFlip(RotateFlipType.RotateNoneFlipNone)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "RotateNoneFlipX" Then
rotateImage.RotateFlip(RotateFlipType.RotateNoneFlipX)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "RotateNoneFlipXY" Then
rotateImage.RotateFlip(RotateFlipType.RotateNoneFlipXY)
PictureBox1.Image = rotateImage
ElseIf ComboBox1.Text = "RotateNoneFlipY" Then
rotateImage.RotateFlip(RotateFlipType.RotateNoneFlipY)
PictureBox1.Image = rotateImage
End If
Well, that's all. It was real easy, wasn't it?
---------------------------------------------------------------------------
Voila! You have just completed making an Image Rotator rotates the image that you provide by 16 rotation types. Now debug and run it by pressing the Start Debugging button located at the main toolstrip. Test it, if it works fine then its SAVING time. You can save your project by going to File -> Save All and then pressing Save.
And there! You have your project and application that works. If you have any problem or can't understand something, please feel free to ask by either a comment or by PM. I have also attached a screenshot.
Please use the Give Thanks button and the Reputation System to appreciate my hard work. I have wrote this tutorial while making an Image Rotator project myself so you can download the source file in the attachments.
Thank you.

You do not have the required permissions to view the files attached to this post.
switch case would be alooot easyer :P
and shouldn't it be Combobox1.selecteditem ?
and shouldn't it be Combobox1.selecteditem ?
YourSocksRoxx wrote:switch case would be alooot easyer :PSwitch case is C#, its Select Case in VB :lol:
Anyway, good tutorial for people that wanna make image editors
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

MrAksel wrote:oops my bad :P thx for tellinYourSocksRoxx wrote:switch case would be alooot easyer :PSwitch case is C#, its Select Case in VB :lol:
Anyway, good tutorial for people that wanna make image editors
Hello there,
Selecting cases is a difficult job for me. I'm a straight way programmer you know. Instead of this, can you please tell how did you like it?
Thank you.
Selecting cases is a difficult job for me. I'm a straight way programmer you know. Instead of this, can you please tell how did you like it?
Thank you.
Usman55 wrote:Hello there,its not hard :|
Selecting cases is a difficult job for me. I'm a straight way programmer you know. Instead of this, can you please tell how did you like it?
Thank you.
just
select case combobox1.selecteditem
case "Rotateblabla"
'do this
case "Rotate20554"
' do smtn else
case .......
end select
lol today you make a little app Rotator
now you post a tut about it
great job i like you tuts
thanks cooll;
now you post a tut about it
great job i like you tuts
thanks cooll;
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
You can also use Graphics.Transform.RotateAt to rotate at a set point for any number of angles.
Anyways, I'm not going to update it for a long time I guess.
9 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023