diff --git a/SB-PictureTagger.sln b/SB-PictureTagger.sln new file mode 100644 index 0000000..c796df1 --- /dev/null +++ b/SB-PictureTagger.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Basic Express 2010 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SB-PictureTagger", "SB-PictureTagger\SB-PictureTagger.vbproj", "{CF4DEB85-2B3F-40D8-9E21-F265316CF41A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CF4DEB85-2B3F-40D8-9E21-F265316CF41A}.Debug|x86.ActiveCfg = Debug|x86 + {CF4DEB85-2B3F-40D8-9E21-F265316CF41A}.Debug|x86.Build.0 = Debug|x86 + {CF4DEB85-2B3F-40D8-9E21-F265316CF41A}.Release|x86.ActiveCfg = Release|x86 + {CF4DEB85-2B3F-40D8-9E21-F265316CF41A}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/SB-PictureTagger/Form_SB-PictureTagger.Designer.vb b/SB-PictureTagger/Form_SB-PictureTagger.Designer.vb new file mode 100644 index 0000000..60c3848 --- /dev/null +++ b/SB-PictureTagger/Form_SB-PictureTagger.Designer.vb @@ -0,0 +1,284 @@ + _ +Partial Class Main + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.b_next = New System.Windows.Forms.Button() + Me.b_last = New System.Windows.Forms.Button() + Me.b_exit = New System.Windows.Forms.Button() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.Label3 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label1 = New System.Windows.Forms.Label() + Me.TextBox2 = New System.Windows.Forms.TextBox() + Me.RichTextBox1 = New System.Windows.Forms.RichTextBox() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.cb_marks_visible = New System.Windows.Forms.CheckBox() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.b_loaddir = New System.Windows.Forms.Button() + Me.b_save = New System.Windows.Forms.Button() + Me.b_reloaddir = New System.Windows.Forms.Button() + Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Position = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Radius = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Column2 = New System.Windows.Forms.DataGridViewTextBoxColumn() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.GroupBox1.SuspendLayout() + Me.GroupBox2.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'PictureBox1 + ' + Me.PictureBox1.Location = New System.Drawing.Point(12, 12) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(717, 618) + Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom + Me.PictureBox1.TabIndex = 0 + Me.PictureBox1.TabStop = False + ' + 'b_next + ' + Me.b_next.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_next.Location = New System.Drawing.Point(196, 661) + Me.b_next.Name = "b_next" + Me.b_next.Size = New System.Drawing.Size(178, 51) + Me.b_next.TabIndex = 2 + Me.b_next.Text = "Folowing" + Me.b_next.UseVisualStyleBackColor = True + ' + 'b_last + ' + Me.b_last.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_last.Location = New System.Drawing.Point(12, 661) + Me.b_last.Name = "b_last" + Me.b_last.Size = New System.Drawing.Size(178, 51) + Me.b_last.TabIndex = 3 + Me.b_last.Text = "Last" + Me.b_last.UseVisualStyleBackColor = True + ' + 'b_exit + ' + Me.b_exit.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_exit.Location = New System.Drawing.Point(916, 661) + Me.b_exit.Name = "b_exit" + Me.b_exit.Size = New System.Drawing.Size(178, 51) + Me.b_exit.TabIndex = 4 + Me.b_exit.Text = "EXIT" + Me.b_exit.UseVisualStyleBackColor = True + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Controls.Add(Me.TextBox2) + Me.GroupBox1.Controls.Add(Me.RichTextBox1) + Me.GroupBox1.Controls.Add(Me.TextBox1) + Me.GroupBox1.Location = New System.Drawing.Point(742, 16) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(352, 163) + Me.GroupBox1.TabIndex = 6 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "MainTaggs" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(8, 74) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(69, 13) + Me.Label3.TabIndex = 5 + Me.Label3.Text = "Kommentare:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(8, 45) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(28, 13) + Me.Label2.TabIndex = 4 + Me.Label2.Text = "Zeit:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(6, 22) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(30, 13) + Me.Label1.TabIndex = 3 + Me.Label1.Text = "Titel:" + ' + 'TextBox2 + ' + Me.TextBox2.Location = New System.Drawing.Point(83, 45) + Me.TextBox2.Name = "TextBox2" + Me.TextBox2.Size = New System.Drawing.Size(263, 20) + Me.TextBox2.TabIndex = 2 + ' + 'RichTextBox1 + ' + Me.RichTextBox1.Location = New System.Drawing.Point(83, 71) + Me.RichTextBox1.Name = "RichTextBox1" + Me.RichTextBox1.Size = New System.Drawing.Size(263, 86) + Me.RichTextBox1.TabIndex = 1 + Me.RichTextBox1.Text = "" + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(83, 19) + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(263, 20) + Me.TextBox1.TabIndex = 0 + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.cb_marks_visible) + Me.GroupBox2.Controls.Add(Me.DataGridView1) + Me.GroupBox2.Location = New System.Drawing.Point(742, 185) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(352, 445) + Me.GroupBox2.TabIndex = 7 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "MarkTaggs" + ' + 'cb_marks_visible + ' + Me.cb_marks_visible.AutoSize = True + Me.cb_marks_visible.Location = New System.Drawing.Point(11, 28) + Me.cb_marks_visible.Name = "cb_marks_visible" + Me.cb_marks_visible.Size = New System.Drawing.Size(121, 17) + Me.cb_marks_visible.TabIndex = 2 + Me.cb_marks_visible.Text = "Zeige Markierungen" + Me.cb_marks_visible.UseVisualStyleBackColor = True + ' + 'DataGridView1 + ' + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Column1, Me.Position, Me.Radius, Me.Column2}) + Me.DataGridView1.Location = New System.Drawing.Point(11, 51) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.Size = New System.Drawing.Size(335, 388) + Me.DataGridView1.TabIndex = 1 + ' + 'b_loaddir + ' + Me.b_loaddir.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_loaddir.Location = New System.Drawing.Point(732, 661) + Me.b_loaddir.Name = "b_loaddir" + Me.b_loaddir.Size = New System.Drawing.Size(178, 51) + Me.b_loaddir.TabIndex = 8 + Me.b_loaddir.Text = "Load Folder" + Me.b_loaddir.UseVisualStyleBackColor = True + ' + 'b_save + ' + Me.b_save.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_save.Location = New System.Drawing.Point(380, 661) + Me.b_save.Name = "b_save" + Me.b_save.Size = New System.Drawing.Size(178, 51) + Me.b_save.TabIndex = 9 + Me.b_save.Text = "Save Chanches" + Me.b_save.UseVisualStyleBackColor = True + ' + 'b_reloaddir + ' + Me.b_reloaddir.Font = New System.Drawing.Font("Comic Sans MS", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.b_reloaddir.Location = New System.Drawing.Point(564, 661) + Me.b_reloaddir.Name = "b_reloaddir" + Me.b_reloaddir.Size = New System.Drawing.Size(165, 51) + Me.b_reloaddir.TabIndex = 10 + Me.b_reloaddir.Text = "Reload Folder" + Me.b_reloaddir.UseVisualStyleBackColor = True + ' + 'Column1 + ' + Me.Column1.HeaderText = "Nr." + Me.Column1.Name = "Column1" + ' + 'Position + ' + Me.Position.HeaderText = "Position" + Me.Position.Name = "Position" + Me.Position.Visible = False + ' + 'Radius + ' + Me.Radius.HeaderText = "Radius" + Me.Radius.Name = "Radius" + Me.Radius.Visible = False + ' + 'Column2 + ' + Me.Column2.HeaderText = "Beschreibung" + Me.Column2.Name = "Column2" + ' + 'Main + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1106, 723) + Me.Controls.Add(Me.b_reloaddir) + Me.Controls.Add(Me.b_save) + Me.Controls.Add(Me.b_loaddir) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Controls.Add(Me.b_exit) + Me.Controls.Add(Me.b_last) + Me.Controls.Add(Me.b_next) + Me.Controls.Add(Me.PictureBox1) + Me.Name = "Main" + Me.Text = "SB-PictureTagger" + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox + Friend WithEvents b_next As System.Windows.Forms.Button + Friend WithEvents b_last As System.Windows.Forms.Button + Friend WithEvents b_exit As System.Windows.Forms.Button + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents TextBox2 As System.Windows.Forms.TextBox + Friend WithEvents RichTextBox1 As System.Windows.Forms.RichTextBox + Friend WithEvents TextBox1 As System.Windows.Forms.TextBox + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents b_loaddir As System.Windows.Forms.Button + Friend WithEvents cb_marks_visible As System.Windows.Forms.CheckBox + Friend WithEvents b_save As System.Windows.Forms.Button + Friend WithEvents b_reloaddir As System.Windows.Forms.Button + Friend WithEvents Column1 As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents Position As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents Radius As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents Column2 As System.Windows.Forms.DataGridViewTextBoxColumn + +End Class diff --git a/SB-PictureTagger/Form_SB-PictureTagger.resx b/SB-PictureTagger/Form_SB-PictureTagger.resx new file mode 100644 index 0000000..78bf064 --- /dev/null +++ b/SB-PictureTagger/Form_SB-PictureTagger.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/SB-PictureTagger/Form_SB-PictureTagger.vb b/SB-PictureTagger/Form_SB-PictureTagger.vb new file mode 100644 index 0000000..8cf4185 --- /dev/null +++ b/SB-PictureTagger/Form_SB-PictureTagger.vb @@ -0,0 +1,105 @@ +Option Explicit On +Imports System.IO + +Public Class Main + 'Deklariere Public Variables + Public pub_aPhotos(0) As String 'Array mit den Photo Pfaden + Public pub_sPath As String 'String mit dem Arbeits Verzeichnis + Public pub_nPhotoIndex As Long = 0 'IndexNR des pub_aPhotos Arrays + Public pub_bChangeTagg As Boolean = False + + '################################################################################################################### + '############### Main ############################################################################################## + '################################################################################################################### + + Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + + End Sub + + + '################################################################################################################### + '############### Form1_Function-Tasks ############################################################################## + '################################################################################################################### + + '################################################################################################################### + '############### Form1_Sub-Tasks ################################################################################### + '################################################################################################################### + + Private Sub Reload() + SaveTagg() + ReDim pub_aPhotos(0) + pub_aPhotos(0) = "" + pub_aPhotos = Modul_SB_PictureTagger.DirReadPhotos(pub_sPath) + pub_nPhotoIndex = 0 + LoadTaggedIMG() + End Sub 'Reload + + Private Sub SaveTagg() + If pub_bChangeTagg = True Then + 'Call The Save Methode from Modul_SB-PictureTagger + pub_bChangeTagg = False + End If + End Sub + + Private Sub LoadTaggedIMG() + Dim ID As String = pub_aPhotos(pub_nPhotoIndex) + Dim TaggedIMG_Now As New TaggedIMG + If ID <> "" Then 'Später wird die ID der DB übergeben + SaveTagg() + TaggedIMG_Now = Modul_SB_PictureTagger.LoadPicture(ID) + PictureBox1.Image = TaggedIMG_Now.Image + 'Befülle TextBox + 'Erstelle Marks + End If + End Sub 'LoadTaggedIMG + + '################################################################################################################### + '############### Buton Events: Click ############################################################################### + '################################################################################################################### + + + Private Sub b_exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_exit.Click + ' Programm Beenden + SaveTagg() + Me.Close() + End Sub + + Private Sub b_loaddir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_loaddir.Click + 'Laden eines zu Taggenden Bilder-Verzeichnis + Modul_Tools.FolderBrowserDialog(pub_sPath) + Reload() + End Sub + + Private Sub b_reloaddir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_reloaddir.Click + Reload() + End Sub + + Private Sub b_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_save.Click + SaveTagg() + End Sub + + Private Sub b_next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_next.Click + If pub_nPhotoIndex < (UBound(pub_aPhotos) - 1) Then + pub_nPhotoIndex += 1 + LoadTaggedIMG() + End If + End Sub + + Private Sub b_last_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_last.Click + + If pub_nPhotoIndex > 0 Then + pub_nPhotoIndex = pub_nPhotoIndex - 1 + LoadTaggedIMG() + End If + End Sub + + '################################################################################################################### + '############### CheckBox Events: CheckStateChanged ################################################################ + '################################################################################################################### + + Private Sub cb_marks_visible_CheckStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cb_marks_visible.CheckStateChanged + 'Wenn cb_marks_visible=true then ZeichneMarks() ELSE VerstekeMarks() + End Sub + + +End Class diff --git a/SB-PictureTagger/Modul_SB-PictureTagger.vb b/SB-PictureTagger/Modul_SB-PictureTagger.vb new file mode 100644 index 0000000..fae9369 --- /dev/null +++ b/SB-PictureTagger/Modul_SB-PictureTagger.vb @@ -0,0 +1,166 @@ +Option Explicit On +Imports System.IO + +Module Modul_SB_PictureTagger + Structure Mark + Dim Position As String + Dim ID As String + Dim Description As String + End Structure 'Mark + Structure Place + Dim Adresse + Dim Description + Dim GPS + End Structure + Structure TaggedIMG + Dim ID As Long + Dim Title As String + Dim Description As String + Dim Time As String + Dim Mark() As Mark + Dim Image As Image + Dim Path As String + Dim Place As Place + End Structure 'TaggedIMG + + 'Methoden Index: + '1.LoadPicture + ' Parameter: "-SupportedFormats-" -> Array of Supported Formats; + ' Parameter: File Pfad -> Picture ##in Work!## + '2.DirReadPhotos + ' Parameter: Ordner Pfad; Return: Array von Pfaden der Bilddateien des Ordners + + + + '################################################################################################################### + '############### 1.LoadPicture ##################################################################################### + '################################################################################################################### + + Public Function LoadPicture(ByVal sPath As String) As Object + 'Deklariere + Dim aPhotoFormats(0) As String 'Array Enthält die Unsterstützten Photoformate + '###Statische Einstellungen### + 'Die Untestützten Formate einstellen + ReDim Preserve aPhotoFormats(5) + aPhotoFormats(0) = ".jpg" + aPhotoFormats(1) = ".bmp" + aPhotoFormats(2) = ".gif" + aPhotoFormats(3) = ".png" + aPhotoFormats(4) = ".jp2" + aPhotoFormats(5) = ".tif" + + 'Entscheide ob Rückgabe des Arrays für die FormatUnterstützung + 'Oder das Laden des Bildes aus der angegebenen Quelle + If sPath = "-SupportedFormats-" Then + LoadPicture = aPhotoFormats + ElseIf (File.Exists(sPath) = True) Then + 'BildLadeFunktion + 'Main Work############################################### + Dim iPicture As New TaggedIMG + + 'Testen ob Vormat unterstüzt! + iPicture.Path = sPath + iPicture.Image = Image.FromFile(sPath) + + 'Wird hier später mit Tagg Bestückt! + + + LoadPicture = iPicture + 'Main Work Ende########################################## + Else + MsgBox("Can't load Picture") + LoadPicture = "" + End If + End Function 'LoadPicture + + + '################################################################################################################### + '############### 2.DirReadPhotos ################################################################################### + '################################################################################################################### + + Public Function DirReadPhotos(ByVal sPath As String) As Object + 'Parameter: Ordner Pfad + 'Return: Array von Pfaden der Bilddateien des Ordners + + + Dim aPhotos(0) As String + Dim i As Long + Dim sPhotoFormat As String + Dim aPhotoFormats(0) As String 'Array Enthält die Unsterstützten Photoformate + + 'Lade Unterstüzte Formate: + aPhotoFormats = LoadPicture("-SupportedFormats-") + + Try + 'Deklarieren + Dim aFiles As String() = Directory.GetFiles(sPath) ' Try verwenden!! <---- + + + + + 'Überprüfen auf existenz des Ordners + 'Ja: Weiter + 'Nein: MsgBox("Error: Der Pfad existiert Nicht!") + If Directory.Exists(sPath) = True Then + + + 'Speichere Pfad in Array aPhotos + 'Wenn das File die Dateiendungen aus Array aPhotoFormats besitzt + + Dim nCount As Long = 0 + If aFiles(0) <> "" Then + aPhotos(0) = "" + For i = 0 To UBound(aFiles) + For Each sPhotoFormat In aPhotoFormats + If IO.Path.GetExtension(aFiles(i)) = sPhotoFormat Then + If nCount > UBound(aPhotos) Then + ReDim Preserve aPhotos(nCount) + End If + aPhotos(nCount) = aFiles(i) + nCount = nCount + 1 + End If + Next sPhotoFormat + Next i + Else + aPhotos(0) = "" + End If + + 'Array Nach Dateinahmen Sortieren + Array.Sort(aPhotos) + + + Else + MsgBox("Error: Der Pfad existiert Nicht!") + aPhotos(0) = "" + End If + DirReadPhotos = aPhotos + Catch ex As Exception + MsgBox(ex.Message) + aPhotos(0) = "" + DirReadPhotos = aPhotos + End Try + End Function 'DirReadPhotos + + + + + + + + + 'Vor VBA AND VB without .Net + + '### with .Net: Imports System.IO; Directory.Exists(Path)#### + 'Private Function FileExists(ByVal FileName As String) As Boolean + ' On Error Resume Next + ' FileExists = Not CBool(GetAttr(FileName) And (vbDirectory Or vbVolume)) + ' On Error GoTo 0 + 'End Function + + '### with .Net: Imports System.IO; File.Exists(Path)#### + 'Private Function DirExists(ByVal DirectoryName As String) As Boolean + ' On Error Resume Next + ' DirExists = CBool(GetAttr(DirectoryName) And vbDirectory) + ' On Error GoTo 0 + 'End Function +End Module diff --git a/SB-PictureTagger/Modul_Tools.vb b/SB-PictureTagger/Modul_Tools.vb new file mode 100644 index 0000000..5e9e409 --- /dev/null +++ b/SB-PictureTagger/Modul_Tools.vb @@ -0,0 +1,183 @@ +Module Modul_Tools + + 'Methonden_Index: + '1.Datei- und Ordnerdialoge (Mindesanforderung: VB.Net 2005; Framework: 2.0) + ' 1.1 FolderBrowserDialog + ' 1.2 OpenFileDialog + ' 1.3 SaveFileDialog + + + + + + + + + + '################################################################################################################### + '############### 1.Datei- und Ordnerdialoge ######################################################################## + '############### http://www.vb-fun.de/dotnet/tipps/tip0212.shtml ################################################### + '################################################################################################################### + + '################################################################################################################### + '############### 1.1 FolderBrowserDialog ########################################################################### + '################################################################################################################### + + Public Sub FolderBrowserDialog(ByRef sPath As String) + 'Verändert die übergebene variable, + 'wenn der benutzer durch "OK" den neuen Pfad bestätigt + + Using fbd As New FolderBrowserDialog + With fbd + ' Ordnervorschlag + .SelectedPath = "c:\" + ' RootFolder verwendet man nur zum Eingrenzen auf eine _ + ' bestimmte Ordnerebene + ' z.B.: .RootFolder = Environment.SpecialFolder.MyPictures + + .Description = "Bitte einen Ordner auswählen." + ' Button "Neuen Ordner erstellen" anzeigen + .ShowNewFolderButton = True + + ' Zeile ruft den Dialog auf, weitere Ausführung nur bei + ' Resultat OK: + + If .ShowDialog = Windows.Forms.DialogResult.OK Then + sPath = .SelectedPath + Else + 'Nothing + End If + End With + End Using + End Sub 'FolderBrowserDialog + + '################################################################################################################### + '############### 1.2 OpenFileDialog ################################################################################ + '################################################################################################################### + + 'Private Sub Button1_Click(ByVal sender As Object, ByVal e As _ + ' EventArgs) Handles Button1.Click + ' ' ### OpenFileDialog ### + ' Dim txt As String = "" + ' Using ofd As New OpenFileDialog + + ' With ofd + ' ' Ordnervorschlag + ' .InitialDirectory = Pfad + ' .Title = "Wähle Datei zum öffnen" + ' ' Dateivorschlag (falls sinnvoll) + ' ' .FileName = "Datei.gif" + + ' ' Filter + ' .Filter = TextBox2.Text + ' ' boolsche Abfrage ob Mehrfachauswahl zulässig + ' .Multiselect = Not ChkEinzel.Checked + + ' ' Zeile ruft den Dialog auf, weitere Ausführung nur bei + ' ' Resultat OK: + ' If .ShowDialog = Windows.Forms.DialogResult.OK Then + ' If ChkEinzel.Checked = True Then + ' ' Bei Einzelauswahl wertet man .FileName aus + ' txt = .FileName & vbNewLine + + ' Else + ' ' Bei möglicher Multiselektion wertet man + ' ' das Array .FileNames aus + ' For Each filename As String In .FileNames + ' txt &= filename & vbNewLine + ' Next + ' End If + ' ' Welcher Filter wurde verwendet? + ' Dim idx As Integer = .FilterIndex + ' txt &= "FilterIndex: " & idx.ToString & vbNewLine + ' txt &= "Gewählter Filter: " & FilterDescription(.Filter, _ + ' idx) & vbNewLine + ' txt &= "Multiselect: " & .Multiselect.ToString + ' Else + ' txt = "Abbruch durch Benutzer" + ' End If + ' End With + ' End Using + ' TextBox1.Text = txt + 'End Sub 'OpenFileDialog + + '################################################################################################################### + '############### 1.3 SaveFileDialog ################################################################################ + '################################################################################################################### + + 'Private Sub Button2_Click(ByVal sender As Object, ByVal e As _ + ' EventArgs) Handles Button2.Click + ' ' ### SaveFileDialog ### + ' Dim txt As String + ' Using sfd As New SaveFileDialog + + ' With sfd + ' ' Ordnervorschlag + ' .InitialDirectory = Pfad + ' .Title = "Eingabe Datei zum speichern (Es wird hier nicht "_ + ' "wirklich überschrieben)" + ' ' Dateivorschlag + ' .FileName = "Datei.gif" + ' ' Filter + ' .Filter = TextBox2.Text + + ' ' Zeile ruft den Dialog auf, weitere Ausführung nur bei + ' ' Resultat OK: + ' If .ShowDialog = Windows.Forms.DialogResult.OK Then + ' txt = .FileName & vbNewLine + + ' ' Welcher Filter wurde verwendet? + ' Dim idx As Integer = .FilterIndex + ' txt &= "FilterIndex: " & idx.ToString & vbNewLine + ' txt &= "Gewählter Filter: " & FilterDescription(.Filter, _ + ' idx) + ' Else + ' txt = "Abbruch durch Benutzer" + ' End If + ' End With + ' End Using + ' TextBox1.Text = txt + 'End Sub 'SaveFileDialog + + '################################################################################################################### + '############### xxxxxxxxxxxxxxxxxxxxxxx ########################################################################### + '################################################################################################################### + + 'Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As _ + ' Object, ByVal e As EventArgs) _ + ' Handles ComboBox1.SelectedIndexChanged + ' Dim strFilter As String + ' Select Case ComboBox1.SelectedIndex + ' Case 0 + ' ' Einfacher Filter + ' strFilter = "Gif Bilddateien|*.gif" + ' Case 1 + ' ' Erweiterter Filter + ' strFilter = "JPEG Bilddateien|*.jpg|Gif Bilddateien|*.gif|Alle Dateien|*.*" + ' Case Else + ' ' Mehrere Dateierweiterungen in einer Auswahl + ' strFilter = "Alle Bilddateien|*.jpg; *.jpeg; *.bmp; *.gif, *.tif|Alle Dateien|*.*" + ' End Select + + ' TextBox2.Text = strFilter + 'End Sub 'ComboBox1_SelectedIndexChanged + + 'Private Function FilterDescription(ByVal Filter As String, _ + ' ByVal Index As Integer) As String + ' ' erstellt aus dem Filterstring die Bezeichnung + ' Dim strArr() As String = Split(Filter, "|"), _ + ' MyList As New List(Of String) + ' For i As Integer = 0 To strArr.GetUpperBound(0) + ' If (i Mod 2 = 0) Then MyList.Add(strArr(i)) + ' Next + ' Return MyList(Index - 1) + 'End Function 'FilterDescription + + '################################################################################################################### + '############### 1.Datei- und Ordnerdialoge ################################# ENDE ######################### + '############### http://www.vb-fun.de/dotnet/tipps/tip0212.shtml ################################################### + '################################################################################################################### + + + +End Module diff --git a/SB-PictureTagger/My Project/Application.Designer.vb b/SB-PictureTagger/My Project/Application.Designer.vb new file mode 100644 index 0000000..66b2af8 --- /dev/null +++ b/SB-PictureTagger/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.1 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.SB_PictureTagger.Main + End Sub + End Class +End Namespace diff --git a/SB-PictureTagger/My Project/Application.myapp b/SB-PictureTagger/My Project/Application.myapp new file mode 100644 index 0000000..f70ccad --- /dev/null +++ b/SB-PictureTagger/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Main + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/SB-PictureTagger/My Project/AssemblyInfo.vb b/SB-PictureTagger/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..bfaa994 --- /dev/null +++ b/SB-PictureTagger/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Allgemeine Informationen über eine Assembly werden über die folgenden +' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +' die mit einer Assembly verknüpft sind. + +' Die Werte der Assemblyattribute überprüfen + + + + + + + + + + +'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird + + +' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +' +' Hauptversion +' Nebenversion +' Buildnummer +' Revision +' +' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +' übernehmen, indem Sie "*" eingeben: +' + + + diff --git a/SB-PictureTagger/My Project/Resources.Designer.vb b/SB-PictureTagger/My Project/Resources.Designer.vb new file mode 100644 index 0000000..c9b34dc --- /dev/null +++ b/SB-PictureTagger/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.1 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SB_PictureTagger.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/SB-PictureTagger/My Project/Resources.resx b/SB-PictureTagger/My Project/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/SB-PictureTagger/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SB-PictureTagger/My Project/Settings.Designer.vb b/SB-PictureTagger/My Project/Settings.Designer.vb new file mode 100644 index 0000000..9c357fd --- /dev/null +++ b/SB-PictureTagger/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.1 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.SB_PictureTagger.My.MySettings + Get + Return Global.SB_PictureTagger.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/SB-PictureTagger/My Project/Settings.settings b/SB-PictureTagger/My Project/Settings.settings new file mode 100644 index 0000000..377f56d --- /dev/null +++ b/SB-PictureTagger/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SB-PictureTagger/SB-PictureTagger.vbproj b/SB-PictureTagger/SB-PictureTagger.vbproj new file mode 100644 index 0000000..0130cd1 --- /dev/null +++ b/SB-PictureTagger/SB-PictureTagger.vbproj @@ -0,0 +1,131 @@ + + + + Debug + x86 + + + 2.0 + {CF4DEB85-2B3F-40D8-9E21-F265316CF41A} + WinExe + SB_PictureTagger.My.MyApplication + SB_PictureTagger + SB-PictureTagger + 512 + WindowsForms + v4.0 + Client + + + x86 + true + full + true + true + bin\Debug\ + SB-PictureTagger.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + x86 + pdbonly + false + true + true + bin\Release\ + SB-PictureTagger.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form_SB-PictureTagger.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + Form_SB-PictureTagger.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/SB-PictureTagger/TaggedIMG.vb b/SB-PictureTagger/TaggedIMG.vb new file mode 100644 index 0000000..999b5bf --- /dev/null +++ b/SB-PictureTagger/TaggedIMG.vb @@ -0,0 +1,32 @@ +'Public Class TaggedIMG2 + +' 'Public Class Mark +' ' Dim Position As String +' ' Dim ID As String +' ' Dim Description As String +' 'End Class 'Mark +' Public Class Place +' Dim Adresse +' Public Description +' Public GPS +' End Class + +' Public Class Mark( +' Public Mark_PositionX() As Long +' Public Mark_PositionY() As Long +' Public Mark_Radius() As Long +' Public Mark_Description() As String +' End Class + +' Public ID As Long +' Public Title As String +' Public Description As String +' Public Time As String +' Public Image As Image +' Public Path As String + + + + + +'End Class