Sunday, March 28

My informational picture viewer

Pictureviewer
_______________________



Public Class pctviewer

Private Sub DirListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DirListBox1.SelectedIndexChanged
Try
FileListBox1.Path = DirListBox1.Path
Catch ex As Exception
End Try
End Sub

Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Dim i As System.Drawing.Image
Try
Dim k, l As String
k = FileListBox1.Path
l = k & "\" & FileListBox1.FileName
Me.Text = l
PictureBox1.ImageLocation = l
i = PictureBox1.Image
TextBox1.Text = i.Height
TextBox2.Text = i.Width
TextBox4.Text = i.VerticalResolution
TextBox3.Text = i.HorizontalResolution
TextBox5.Text = i.PixelFormat
TextBox6.Text = i.Flags
Catch ex As Exception
End Try
End Sub

Private Sub DriveListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveListBox1.SelectedIndexChanged
Try
Dim a As String
a = DriveListBox1.Drive
DirListBox1.Path = a
Catch ex As Exception
End Try
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim a As System.Drawing.Bitmap
a = PictureBox1.Image
a.SetResolution(TextBox7.Text, TextBox8.Text)
PictureBox1.Image = a
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "Normal" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.Normal
ElseIf ComboBox1.Text = "Stretched" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
ElseIf ComboBox1.Text = "Zoom" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
ElseIf ComboBox1.Text = "CenterImage" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage
End If
Me.Refresh()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As System.Drawing.Image
i = PictureBox1.Image
i.RotateFlip(RotateFlipType.Rotate90FlipXY)
PictureBox1.Image = i
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As System.Drawing.Image
i = PictureBox1.Image
Dim SaveFile1 As New SaveFileDialog()
SaveFile1.DefaultExt = "*.jpeg"
SaveFile1.Filter = "JPG Files(*.jpg*)|*.jpg|PIF(*.pif*)|*.pif|All files (*.*)|*.*"
SaveFile1.CheckPathExists = True
SaveFile1.Title = "Save File"
' Determine whether the user selected a file name from the saveFileDialog.
Try
If (SaveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
And (SaveFile1.FileName.Length > 0) Then
' Save the contents of the RichTextBox into the file.
i.Save(SaveFile1.FileName)
End If
Catch ex As Exception 'Do nothing on Exception
End Try
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim a As System.Drawing.Image
a = PictureBox1.Image
a.RotateFlip(RotateFlipType.Rotate270FlipXY)
PictureBox1.Image = a
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ComboBox1.Text = "Zoom"
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
ComboBox1.Text = "CenterImage"
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Form4.Show()
End Sub
End Class


DOWNLOAD

No comments: