|
| |

VB.NET - Ein- und Umsteiger| dritter - letzter Teil Code | |  | | Autor: Kapitän Forelle | | Datum: 25.02.11 00:44 |
| Private Sub fncSave(ByVal sender As Object, ByVal ea As EventArgs)
Try ' save the image in the required format.
Dim dlgSave As New SaveFileDialog
dlgSave.Filter = "JPEG Images (*.jpg,*.jpeg)|*.jpg;*.jpeg|Gif Images (" & _
"*.gif)|*.gif|Bitmaps (*.bmp)|*.bmp"
If dlgSave.ShowDialog() = DialogResult.OK Then
strImgName = dlgSave.FileName
If strImgName.EndsWith("jpg") Then
pbxImg.Image.Save(strImgName, ImageFormat.Jpeg)
End If
If strImgName.EndsWith("gif") Then
pbxImg.Image.Save(strImgName, ImageFormat.Gif)
End If
If strImgName.EndsWith("bmp") Then
pbxImg.Image.Save(strImgName, ImageFormat.Bmp)
End If
End If
Catch e As Exception
Console.WriteLine(e.StackTrace)
End Try
End Sub 'fncSave
Private Sub fncRot(ByVal obj As Object, ByVal ea As EventArgs)
rbnTemp = CType(obj, RadioButton)
strRot = rbnTemp.Name
setStatus()
End Sub 'fncRot
Private Sub fncFlip(ByVal obj As Object, ByVal ea As EventArgs)
rbnTemp = CType(obj, RadioButton)
strFlip = rbnTemp.Name
setStatus()
End Sub 'fncFlip
Private Sub fncTransform(ByVal obj As Object, ByVal ea As EventArgs)
Dim btnTemp As Button = CType(obj, Button)
If btnTemp.Text = "Transform Image" Then
strRotFlip = strRot + strFlip
Select Case strRotFlip
Case "180None"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipNone)
Case "180X"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipX)
Case "180Y"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipY)
Case "180XY"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipXY)
Case "270None"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipNone)
Case "270X"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipX)
Case "270Y"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipY)
Case "270XY"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipXY)
Case "90None"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipNone)
Case "90X"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipX)
Case "90Y"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipY)
Case "90XY"
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipXY)
Case "NoneNone"
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipNone)
Case "NoneX"
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipX)
Case "NoneY"
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipY)
Case "NoneXY"
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipXY)
Case Else
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipNone)
End Select
Else
If btnTemp.Text = "Original Position" Then
pbxImg.Image = Image.FromFile(strImgName)
pbxImg.Refresh()
End If
End If
pbxImg.Refresh()
End Sub 'fncTransform
Private Sub fncPicMode(ByVal obj As Object, ByVal ea As EventArgs)
Dim objTemp As ComboBox = CType(obj, ComboBox)
Select Case objTemp.SelectedIndex
Case 0
pbxImg.SizeMode = PictureBoxSizeMode.AutoSize
strStatus = "AutoSize mode - The PictureBox is sized equal to the size of the" & _
"image that it contains."
Case 1
pbxImg.SizeMode = PictureBoxSizeMode.CenterImage
strStatus = "CenterImage mode - Image is placed in the center of the Picture" & _
"Box."
strStatus = strStatus + "If the image is big then outside edges of Image is" & _
"clipped."
Case 2
pbxImg.SizeMode = PictureBoxSizeMode.Normal
strStatus = "Normal mode - Image is clipped if it is bigger than the Picture" & _
"Box."
Case 3
pbxImg.SizeMode = PictureBoxSizeMode.StretchImage
strStatus = "Stretch mode - Image is stretched or shrunk to fit the Picture" & _
"Box."
End Select
pbxImg.Refresh()
stbBtm.Text = strStatus
End Sub 'fncPicMode
Private Sub setStatus()
strStatus = "The Image is rotated "
If Not (strRot Is Nothing) And strRot <> "None" Then
strStatus = strStatus + strRot + " degrees"
End If
If Not (strFlip Is Nothing) And strFlip <> "None" Then
strStatus = strStatus + " around " + strFlip + " axis."
End If
stbBtm.Text = strStatus
End Sub 'setStatus
Private Sub fncExit(ByVal obj As Object, ByVal ea As EventArgs)
Application.Exit()
End Sub 'fncExit
End Class 'win |  |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
TOP! Unser Nr. 1 
Neu! sevDataGrid 3.0
Mehrspaltige Listen, mit oder ohne DB-Anbindung. Autom. Sortierung, Editieren von Spalteninhalten oder das interaktive Hinzufügen von Datenzeilen sind ebenso möglich wie das Erstellen eines Web-Reports. Weitere InfosTipp des Monats Access-Tools Vol.1 
Über 400 MByte Inhalt
Mehr als 250 Access-Beispiele, 25 Add-Ins und ActiveX-Komponenten, 16 VB-Projekt inkl. Source, mehr als 320 Tipps & Tricks für Access und VB
Nur 24,95 EURWeitere Infos
|
| |
|
Copyright ©2000-2025 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|