vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

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
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Viewer testen1.344Kapitän Forelle25.02.11 00:37
erster Teil Code959Kapitän Forelle25.02.11 00:42
zweiter Teil Code2.526Kapitän Forelle25.02.11 00:43
dritter - letzter Teil Code982Kapitän Forelle25.02.11 00:44
Re: dritter - letzter Teil Code928Manfred X25.02.11 00:57
Re: dritter - letzter Teil Code933Kapitän Forelle25.02.11 18:12
Re: dritter - letzter Teil Code955Manfred X25.02.11 19:17
Re: dritter - letzter Teil Code864Maas25.02.11 19:19
Re: Viewer testen908ModeratorFZelle25.02.11 10:57
Re: Viewer testen868Kapitän Forelle25.02.11 21:02
Re: Viewer testen846ModeratorFZelle02.03.11 12:30
Eigenschaften-Enumeration an Combobox binden1.332Manfred X26.02.11 07:46

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

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

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