v0.3
This commit is contained in:
parent
a7f9f80830
commit
0d3be9180a
165
SB-PictureTagger/Classen.vb
Normal file
165
SB-PictureTagger/Classen.vb
Normal file
@ -0,0 +1,165 @@
|
||||
Namespace Stammbaum.Classen
|
||||
Namespace PictureTagger
|
||||
'HauptClasse von PictureTagger ################################
|
||||
Public Class TaggedIMG
|
||||
|
||||
Private sID As String 'Datenbankeintrag - In diesemfall Dateinahme :) da INI
|
||||
Public Property ID() As String
|
||||
Get
|
||||
Return sID
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sTitle As String
|
||||
Public Property Title() As String
|
||||
Get
|
||||
Return sTitle
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sTitle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sDescription As String
|
||||
Public Property Description() As String
|
||||
Get
|
||||
Return sDescription
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sTime As String
|
||||
Public Property Time() As String
|
||||
Get
|
||||
Return sTime
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private iImage As Image
|
||||
Public Property Image() As Image
|
||||
Get
|
||||
Return iImage
|
||||
End Get
|
||||
Set(ByVal value As Image)
|
||||
iImage = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sPath As String
|
||||
Public Property Path() As String
|
||||
Get
|
||||
Return sPath
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sPath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private oOrt As New Stammbaum.Classen.Place
|
||||
Public Property Ort() As Stammbaum.Classen.Place 'AufnahmeOrt
|
||||
Get
|
||||
Return oOrt
|
||||
End Get
|
||||
Set(ByVal value As Stammbaum.Classen.Place)
|
||||
oOrt = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Markierung() As Stammbaum.Classen.PictureTagger.Mark
|
||||
'Hier werden Funktionen und Rotienen Geschreiben die die Markierungen steuern ....
|
||||
'Ob Array oder eigene Classe steht noch nicht vest, leider
|
||||
|
||||
Public Sub Clear()
|
||||
Me.sID = Nothing
|
||||
Me.iImage = Nothing
|
||||
Me.sTitle = Nothing
|
||||
Me.sDescription = Nothing
|
||||
Me.sTime = Nothing
|
||||
Me.sPath = Nothing
|
||||
Me.oOrt.Clear()
|
||||
ReDim Me.Markierung(0) '####################### <<<<======= Hier werden Funktionen und Rotienen Geschreiben die die Markierungen steuern ....
|
||||
End Sub
|
||||
|
||||
Public Sub Create_NewMark(ByVal ID As Long, ByVal PositionX As Long, ByVal PositionY As Long, Optional ByVal Radius As Long = 10, Optional ByVal Description As String = "")
|
||||
' Dim Index As Integer
|
||||
' 'If Me.Mark(0) is not Initalisiert Then
|
||||
' ' Index = 0
|
||||
' 'Else
|
||||
' Index = 1 + UBound(Me.Markierung)
|
||||
' 'End if
|
||||
' ReDim Me.Markierung(Index)
|
||||
' Me.Markierung(Index).ID = ID
|
||||
' Me.Markierung(Index).PositionX = PositionX
|
||||
' Me.Markierung(Index).PositionY = PositionY
|
||||
' Me.Markierung(Index).Radius = Radius
|
||||
' Me.Markierung(Index).Description = Description
|
||||
End Sub 'In Arbeit - Erst wenn Mark eindeutig Vestgelegt :(
|
||||
|
||||
End Class 'TaggedIMG
|
||||
'#######################################################
|
||||
Public Class Mark
|
||||
Public PositionX As Long
|
||||
Public PositionY As Long
|
||||
Public ID As Long
|
||||
Public Radius As Long
|
||||
Public Description As String
|
||||
End Class 'Mark <<-- In Work!! Don't forget! ;) MainFeture
|
||||
End Namespace 'PictureTagger
|
||||
'#################################################
|
||||
Public Class Place
|
||||
Private sTitle As String
|
||||
Public Property Title() As String
|
||||
Get
|
||||
Return sTitle
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sTitle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sAdresse As String
|
||||
Public Property Adresse() As String
|
||||
Get
|
||||
Return sAdresse
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sAdresse = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sDescription As String
|
||||
Public Property Description() As String
|
||||
Get
|
||||
Return sDescription
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private sGPS As String
|
||||
Public Property GPS() As String
|
||||
Get
|
||||
Return sGPS
|
||||
End Get
|
||||
Set(ByVal value As String) 'Später eventuelle überprüfung auf format und deren Umwandlung -GPS Formate-
|
||||
sGPS = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub Clear()
|
||||
Me.sAdresse = Nothing
|
||||
Me.sDescription = Nothing
|
||||
Me.sGPS = Nothing
|
||||
End Sub
|
||||
|
||||
End Class 'Place
|
||||
End Namespace 'Stammbaum.Classen
|
@ -43,6 +43,8 @@ Partial Class Main
|
||||
Me.b_save = New System.Windows.Forms.Button()
|
||||
Me.b_reloaddir = New System.Windows.Forms.Button()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label9 = New System.Windows.Forms.Label()
|
||||
Me.tb_Place_Title = New System.Windows.Forms.TextBox()
|
||||
Me.rtb_Place_Description = New System.Windows.Forms.RichTextBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
@ -50,6 +52,8 @@ Partial Class Main
|
||||
Me.tb_Place_GPS = New System.Windows.Forms.TextBox()
|
||||
Me.tb_Place_Addresse = New System.Windows.Forms.TextBox()
|
||||
Me.GroupBox4 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label8 = New System.Windows.Forms.Label()
|
||||
Me.NumericUpDown_OrdnerTiefe = New System.Windows.Forms.NumericUpDown()
|
||||
Me.cb_AutoSave = New System.Windows.Forms.CheckBox()
|
||||
Me.cb_marks_visible = New System.Windows.Forms.CheckBox()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
@ -59,6 +63,7 @@ Partial Class Main
|
||||
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.GroupBox3.SuspendLayout()
|
||||
Me.GroupBox4.SuspendLayout()
|
||||
CType(Me.NumericUpDown_OrdnerTiefe, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'PictureBox1
|
||||
@ -155,8 +160,7 @@ Partial Class Main
|
||||
Me.rtb_Bild_Description.Name = "rtb_Bild_Description"
|
||||
Me.rtb_Bild_Description.Size = New System.Drawing.Size(263, 86)
|
||||
Me.rtb_Bild_Description.TabIndex = 1
|
||||
Me.rtb_Bild_Description.Text = "Tasks: Info in Textvelder laden, Mark-Array Funktion,LoadPhotoDir abfangen einer " & _
|
||||
"lehren Pfadangabe, Kreat New Class TaggedIMG"
|
||||
Me.rtb_Bild_Description.Text = "Markierungen Hinzufügen !"
|
||||
'
|
||||
'tb_Bild_Title
|
||||
'
|
||||
@ -168,9 +172,9 @@ Partial Class Main
|
||||
'GroupBox2
|
||||
'
|
||||
Me.GroupBox2.Controls.Add(Me.DataGridView1)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(742, 317)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(742, 345)
|
||||
Me.GroupBox2.Name = "GroupBox2"
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(352, 246)
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(352, 218)
|
||||
Me.GroupBox2.TabIndex = 7
|
||||
Me.GroupBox2.TabStop = False
|
||||
Me.GroupBox2.Text = "Markierungen"
|
||||
@ -238,6 +242,8 @@ Partial Class Main
|
||||
'
|
||||
'GroupBox3
|
||||
'
|
||||
Me.GroupBox3.Controls.Add(Me.Label9)
|
||||
Me.GroupBox3.Controls.Add(Me.tb_Place_Title)
|
||||
Me.GroupBox3.Controls.Add(Me.rtb_Place_Description)
|
||||
Me.GroupBox3.Controls.Add(Me.Label4)
|
||||
Me.GroupBox3.Controls.Add(Me.Label5)
|
||||
@ -246,14 +252,30 @@ Partial Class Main
|
||||
Me.GroupBox3.Controls.Add(Me.tb_Place_Addresse)
|
||||
Me.GroupBox3.Location = New System.Drawing.Point(742, 184)
|
||||
Me.GroupBox3.Name = "GroupBox3"
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(352, 127)
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(352, 155)
|
||||
Me.GroupBox3.TabIndex = 11
|
||||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "Aufnahme Ort"
|
||||
'
|
||||
'Label9
|
||||
'
|
||||
Me.Label9.AutoSize = True
|
||||
Me.Label9.Location = New System.Drawing.Point(8, 23)
|
||||
Me.Label9.Name = "Label9"
|
||||
Me.Label9.Size = New System.Drawing.Size(30, 13)
|
||||
Me.Label9.TabIndex = 8
|
||||
Me.Label9.Text = "Title:"
|
||||
'
|
||||
'tb_Place_Title
|
||||
'
|
||||
Me.tb_Place_Title.Location = New System.Drawing.Point(83, 16)
|
||||
Me.tb_Place_Title.Name = "tb_Place_Title"
|
||||
Me.tb_Place_Title.Size = New System.Drawing.Size(263, 20)
|
||||
Me.tb_Place_Title.TabIndex = 7
|
||||
'
|
||||
'rtb_Place_Description
|
||||
'
|
||||
Me.rtb_Place_Description.Location = New System.Drawing.Point(83, 69)
|
||||
Me.rtb_Place_Description.Location = New System.Drawing.Point(83, 97)
|
||||
Me.rtb_Place_Description.Name = "rtb_Place_Description"
|
||||
Me.rtb_Place_Description.Size = New System.Drawing.Size(263, 52)
|
||||
Me.rtb_Place_Description.TabIndex = 6
|
||||
@ -262,7 +284,7 @@ Partial Class Main
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(8, 74)
|
||||
Me.Label4.Location = New System.Drawing.Point(6, 97)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(69, 13)
|
||||
Me.Label4.TabIndex = 5
|
||||
@ -271,7 +293,7 @@ Partial Class Main
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(8, 45)
|
||||
Me.Label5.Location = New System.Drawing.Point(6, 71)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(67, 13)
|
||||
Me.Label5.TabIndex = 4
|
||||
@ -280,7 +302,7 @@ Partial Class Main
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(6, 22)
|
||||
Me.Label6.Location = New System.Drawing.Point(8, 45)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(48, 13)
|
||||
Me.Label6.TabIndex = 3
|
||||
@ -288,20 +310,22 @@ Partial Class Main
|
||||
'
|
||||
'tb_Place_GPS
|
||||
'
|
||||
Me.tb_Place_GPS.Location = New System.Drawing.Point(83, 45)
|
||||
Me.tb_Place_GPS.Location = New System.Drawing.Point(83, 71)
|
||||
Me.tb_Place_GPS.Name = "tb_Place_GPS"
|
||||
Me.tb_Place_GPS.Size = New System.Drawing.Size(263, 20)
|
||||
Me.tb_Place_GPS.TabIndex = 2
|
||||
'
|
||||
'tb_Place_Addresse
|
||||
'
|
||||
Me.tb_Place_Addresse.Location = New System.Drawing.Point(83, 19)
|
||||
Me.tb_Place_Addresse.Location = New System.Drawing.Point(83, 42)
|
||||
Me.tb_Place_Addresse.Name = "tb_Place_Addresse"
|
||||
Me.tb_Place_Addresse.Size = New System.Drawing.Size(263, 20)
|
||||
Me.tb_Place_Addresse.TabIndex = 0
|
||||
'
|
||||
'GroupBox4
|
||||
'
|
||||
Me.GroupBox4.Controls.Add(Me.Label8)
|
||||
Me.GroupBox4.Controls.Add(Me.NumericUpDown_OrdnerTiefe)
|
||||
Me.GroupBox4.Controls.Add(Me.cb_AutoSave)
|
||||
Me.GroupBox4.Controls.Add(Me.cb_marks_visible)
|
||||
Me.GroupBox4.Location = New System.Drawing.Point(742, 569)
|
||||
@ -311,6 +335,23 @@ Partial Class Main
|
||||
Me.GroupBox4.TabStop = False
|
||||
Me.GroupBox4.Text = "Optionen"
|
||||
'
|
||||
'Label8
|
||||
'
|
||||
Me.Label8.AutoSize = True
|
||||
Me.Label8.Location = New System.Drawing.Point(199, 19)
|
||||
Me.Label8.Name = "Label8"
|
||||
Me.Label8.Size = New System.Drawing.Size(63, 13)
|
||||
Me.Label8.TabIndex = 6
|
||||
Me.Label8.Text = "OrdnerTiefe"
|
||||
'
|
||||
'NumericUpDown_OrdnerTiefe
|
||||
'
|
||||
Me.NumericUpDown_OrdnerTiefe.Location = New System.Drawing.Point(162, 16)
|
||||
Me.NumericUpDown_OrdnerTiefe.Maximum = New Decimal(New Integer() {3, 0, 0, 0})
|
||||
Me.NumericUpDown_OrdnerTiefe.Name = "NumericUpDown_OrdnerTiefe"
|
||||
Me.NumericUpDown_OrdnerTiefe.Size = New System.Drawing.Size(31, 20)
|
||||
Me.NumericUpDown_OrdnerTiefe.TabIndex = 5
|
||||
'
|
||||
'cb_AutoSave
|
||||
'
|
||||
Me.cb_AutoSave.AutoSize = True
|
||||
@ -367,6 +408,7 @@ Partial Class Main
|
||||
Me.GroupBox3.PerformLayout()
|
||||
Me.GroupBox4.ResumeLayout(False)
|
||||
Me.GroupBox4.PerformLayout()
|
||||
CType(Me.NumericUpDown_OrdnerTiefe, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@ -402,5 +444,9 @@ Partial Class Main
|
||||
Friend WithEvents cb_AutoSave As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents cb_marks_visible As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents Label7 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label8 As System.Windows.Forms.Label
|
||||
Friend WithEvents NumericUpDown_OrdnerTiefe As System.Windows.Forms.NumericUpDown
|
||||
Friend WithEvents Label9 As System.Windows.Forms.Label
|
||||
Friend WithEvents tb_Place_Title As System.Windows.Forms.TextBox
|
||||
|
||||
End Class
|
218
SB-PictureTagger/F_SB_PictureTagger.vb
Normal file
218
SB-PictureTagger/F_SB_PictureTagger.vb
Normal file
@ -0,0 +1,218 @@
|
||||
Option Explicit On
|
||||
Imports System.IO
|
||||
Imports SB_PictureTagger.Stammbaum
|
||||
|
||||
Public Class Main
|
||||
'###################################################################################################################
|
||||
'############### Main ##############################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
'Initial
|
||||
Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Clear()
|
||||
LoadConfigForm()
|
||||
|
||||
End Sub 'Main_Load
|
||||
|
||||
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
|
||||
SaveTagg()
|
||||
SaveConfigForm()
|
||||
End Sub 'Form1_Closing
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Form1_Function-Tasks ##############################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Form1_Sub-Tasks ###################################################################################
|
||||
'###################################################################################################################
|
||||
Private Sub Clear_Form()
|
||||
tb_Bild_Time.Clear()
|
||||
tb_Bild_Title.Clear()
|
||||
tb_Place_Addresse.Clear()
|
||||
tb_Place_GPS.Clear()
|
||||
rtb_Bild_Description.Clear()
|
||||
rtb_Place_Description.Clear()
|
||||
End Sub 'Resetet die Form
|
||||
|
||||
Private Sub LoadConfigForm()
|
||||
'Unsterstützte Formate
|
||||
ReDim Settings.PictureTagger.pub_aSupportedFiles(5)
|
||||
Settings.PictureTagger.pub_aSupportedFiles(0) = ".jpg"
|
||||
Settings.PictureTagger.pub_aSupportedFiles(1) = ".bmp"
|
||||
Settings.PictureTagger.pub_aSupportedFiles(2) = ".gif"
|
||||
Settings.PictureTagger.pub_aSupportedFiles(3) = ".png"
|
||||
Settings.PictureTagger.pub_aSupportedFiles(4) = ".jp2"
|
||||
Settings.PictureTagger.pub_aSupportedFiles(5) = ".tif"
|
||||
'Portable oder Nicht komming soon!
|
||||
|
||||
End Sub 'LoadConfigForm
|
||||
Private Sub SaveConfigForm()
|
||||
'Wird noch Programmert, stürzt sich auf Stammbaum.Settings
|
||||
End Sub
|
||||
|
||||
Private Sub Reload()
|
||||
SaveTaggByEvent()
|
||||
Stammbaum.Module.PictureTagger.PT_LoadVerzeichnis()
|
||||
LoadTaggedIMG()
|
||||
End Sub 'Reload
|
||||
|
||||
Private Sub SaveTaggByEvent()
|
||||
If Settings.PictureTagger.pub_bChangeTagg Then
|
||||
If Not System.IO.File.Exists(Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Path) Then
|
||||
Settings.PictureTagger.pub_bChangeTagg = False
|
||||
ElseIf cb_AutoSave.Checked Then
|
||||
SaveTagg()
|
||||
ElseIf MessageBox.Show("Do you want to save changes?", "SB-PictureTagger", MessageBoxButtons.YesNo) = DialogResult.Yes Then
|
||||
SaveTagg()
|
||||
Else
|
||||
Settings.PictureTagger.pub_bChangeTagg = False
|
||||
End If
|
||||
End If
|
||||
End Sub 'SaveTaggByEvent Like: Next/Last Picture, Colse Form, ...
|
||||
|
||||
Private Sub SaveTagg()
|
||||
|
||||
If Settings.PictureTagger.pub_aPfade(Settings.PictureTagger.pub_nPfadeIndex) <> "" Then
|
||||
|
||||
'TextBox sichern
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Title = tb_Bild_Title.Text
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Time = tb_Bild_Time.Text
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Description = rtb_Bild_Description.Text
|
||||
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Title = tb_Place_Title.Text
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Adresse = tb_Place_Addresse.Text
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.GPS = tb_Place_GPS.Text
|
||||
Stammbaum.Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Description = rtb_Place_Description.Text
|
||||
|
||||
'Lese Markierungen <-- in Planung (Fieleicht Überflüsig, jenachdem wie Markierungen angesteuert werden
|
||||
|
||||
Stammbaum.Module.PictureTagger.PT_SaveTaggedIMG()
|
||||
|
||||
End If
|
||||
Settings.PictureTagger.pub_bChangeTagg = False
|
||||
End Sub 'SaveTagg to What ever is Configurated in Stammbaum.Module.PictureTagger
|
||||
|
||||
Private Sub LoadTaggedIMG()
|
||||
|
||||
SaveTaggByEvent()
|
||||
|
||||
'Textvelder Lehren
|
||||
Clear_Form()
|
||||
|
||||
'Lade neues TaggedIMG mit Stammbaum.Module.PictureTagger Modul
|
||||
Stammbaum.Module.PictureTagger.PT_LoadTaggedIMG()
|
||||
|
||||
'Zeigt den BildPfad unter der PictureBox an
|
||||
Label7.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Path
|
||||
|
||||
'Befülle die TextBox-en
|
||||
tb_Bild_Title.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Title
|
||||
tb_Bild_Time.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Time
|
||||
rtb_Bild_Description.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Description
|
||||
|
||||
tb_Place_Title.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Title
|
||||
tb_Place_Addresse.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Adresse
|
||||
tb_Place_GPS.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.GPS
|
||||
rtb_Place_Description.Text = Settings.PictureTagger.Pub_oLoaded_TaggedIMG.Ort.Description
|
||||
|
||||
'Erstelle Marks
|
||||
|
||||
End Sub 'LoadTaggedIMG -> SaveTaggByEvent()
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Buton Events: Click ###############################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
|
||||
Private Sub b_exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_exit.Click
|
||||
' Programm Beenden
|
||||
Me.Close()
|
||||
End Sub 'Cloas Programm
|
||||
|
||||
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
|
||||
Dim sTMP As String
|
||||
sTMP = Tools.Dialoge.FolderBrowserDialog()
|
||||
If Directory.Exists(sTMP) Then
|
||||
Settings.PictureTagger.Pub_sPath = sTMP
|
||||
Reload()
|
||||
End If
|
||||
End Sub 'Öffne Ordner -> wenn Pfad OK -> Reload()
|
||||
|
||||
Private Sub b_reloaddir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_reloaddir.Click
|
||||
Reload()
|
||||
End Sub 'Relaod()
|
||||
|
||||
Private Sub b_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_save.Click
|
||||
If Settings.PictureTagger.pub_bChangeTagg Then
|
||||
SaveTagg()
|
||||
End If
|
||||
End Sub 'Wenn Änderung -> SaveTagg()
|
||||
|
||||
Private Sub b_next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_next.Click
|
||||
If Settings.PictureTagger.pub_nPfadeIndex < UBound(Settings.PictureTagger.pub_aPfade) Then
|
||||
Settings.PictureTagger.pub_nPfadeIndex += 1
|
||||
LoadTaggedIMG()
|
||||
End If
|
||||
End Sub 'Next Index -> LoadTaggedIMG()
|
||||
|
||||
Private Sub b_last_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_last.Click
|
||||
If Settings.PictureTagger.pub_nPfadeIndex > 0 Then
|
||||
Settings.PictureTagger.pub_nPfadeIndex = Settings.PictureTagger.pub_nPfadeIndex - 1
|
||||
LoadTaggedIMG()
|
||||
End If
|
||||
End Sub 'Last Index -> LoadTaggedIMG()
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### TextBox: TextCanched ##############################################################################
|
||||
'###################################################################################################################
|
||||
Private Sub rtb_Bild_Description_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtb_Bild_Description.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Description Changed
|
||||
|
||||
Private Sub rtb_Place_Description_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtb_Place_Description.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Ort Descriptio Changed
|
||||
|
||||
Private Sub tb_Bild_Time_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Bild_Time.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Time Changed
|
||||
|
||||
Private Sub tb_Bild_Title_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Bild_Title.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Titel Changed
|
||||
|
||||
Private Sub tb_Place_Title_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Place_Title.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Ort Titel Changed
|
||||
|
||||
Private Sub tb_Place_Addresse_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Place_Addresse.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Ort Addresse Changed
|
||||
|
||||
Private Sub tb_Place_GPS_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Place_GPS.TextChanged
|
||||
Settings.PictureTagger.pub_bChangeTagg = True
|
||||
End Sub 'Ort GPS Changed
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### CheckBox Events: CheckStateChanged ################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Private Sub cb_marks_visible_CheckStateChanged(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
'Wenn cb_marks_visible=true then ZeichneMarks() ELSE VerstekeMarks()
|
||||
End Sub 'Visible/Hide Markierungen
|
||||
|
||||
'###################################################################################################################
|
||||
'############### NumericUpDown Events: ValueChanged ################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Private Sub NumericUpDown_OrdnerTiefe_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles NumericUpDown_OrdnerTiefe.ValueChanged
|
||||
Settings.PictureTagger.nOrdnerTiefe = NumericUpDown_OrdnerTiefe.Value
|
||||
End Sub 'Ordner Tiefe Festlegen
|
||||
|
||||
|
||||
End Class
|
@ -1,213 +0,0 @@
|
||||
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 'Wenn ein Tagg geänderd wird:= True bis SaveTagg()
|
||||
Public pub_aConfigForm(0) As Object 'Array mit FormConfiguration
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Main ##############################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
'Initial
|
||||
LoadConfigForm()
|
||||
|
||||
End Sub 'Main_Load
|
||||
|
||||
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
|
||||
SaveTagg()
|
||||
SaveConfigForm()
|
||||
End Sub 'Form1_Closing
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Form1_Function-Tasks ##############################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Form1_Sub-Tasks ###################################################################################
|
||||
'###################################################################################################################
|
||||
Private Sub Clear()
|
||||
tb_Bild_Time.Clear()
|
||||
tb_Bild_Title.Clear()
|
||||
tb_Place_Addresse.Clear()
|
||||
tb_Place_GPS.Clear()
|
||||
rtb_Bild_Description.Clear()
|
||||
rtb_Place_Description.Clear()
|
||||
ReDim pub_aPhotos(0)
|
||||
pub_aPhotos(0) = Nothing
|
||||
pub_nPhotoIndex = 0
|
||||
End Sub
|
||||
|
||||
Private Sub LoadConfigForm()
|
||||
'pub_aConfigForm()
|
||||
' <--- IN Work
|
||||
'pub_sPath = INI:last_Path
|
||||
End Sub 'LoadConfigForm
|
||||
|
||||
Private Sub SaveConfigForm()
|
||||
'pub_aConfigForm()
|
||||
' <--- IN Work
|
||||
'INI:last_Path = pub_sPath
|
||||
'INI:Auto_Save =
|
||||
End Sub 'SaveConfigForm
|
||||
|
||||
Private Sub Reload()
|
||||
SaveTaggByEvent()
|
||||
pub_aPhotos = Modul_SB_PictureTagger.DirReadPhotos(pub_sPath)
|
||||
LoadTaggedIMG()
|
||||
End Sub 'Reload
|
||||
|
||||
Private Sub SaveTagg()
|
||||
|
||||
Dim ID As String = pub_aPhotos(pub_nPhotoIndex)
|
||||
Dim iTaggedIMG As New TaggedIMG
|
||||
If ID <> "" Then 'Später wird die ID der DB übergeben
|
||||
|
||||
iTaggedIMG = Modul_SB_PictureTagger.LoadPicture(ID)
|
||||
Label7.Text = iTaggedIMG.Path
|
||||
|
||||
'TextBox sichern
|
||||
If tb_Bild_Time.Text <> Nothing Then iTaggedIMG.Time = tb_Bild_Time.Text
|
||||
If tb_Place_Addresse.Text <> Nothing Then iTaggedIMG.Ort.Adresse = tb_Place_Addresse.Text
|
||||
If tb_Place_GPS.Text <> Nothing Then iTaggedIMG.Ort.GPS = tb_Place_GPS.Text
|
||||
If rtb_Bild_Description.Text <> Nothing Then iTaggedIMG.Description = rtb_Bild_Description.Text
|
||||
If rtb_Place_Description.Text <> Nothing Then iTaggedIMG.Ort.Description = rtb_Place_Description.Text
|
||||
|
||||
'Erstelle Marks
|
||||
'Lese Marks
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'Call The Save Methode from Modul_SB-PictureTagger
|
||||
'Modul_SB_PictureTagger.Save_Taggs(pub_iTaggedIMG, IO.Path.GetDirectoryName(pub_sPath))
|
||||
pub_bChangeTagg = False
|
||||
End Sub 'SaveTagg
|
||||
|
||||
Private Sub SaveTaggByEvent()
|
||||
If pub_bChangeTagg Then
|
||||
If cb_AutoSave.Checked Then
|
||||
SaveTagg()
|
||||
ElseIf MessageBox.Show("Do you want to save changes?", "SB-PictureTagger", MessageBoxButtons.YesNo) = DialogResult.Yes Then
|
||||
SaveTagg()
|
||||
Else
|
||||
pub_bChangeTagg = False
|
||||
End If
|
||||
End If
|
||||
End Sub 'SaveTaggByEvent
|
||||
|
||||
Private Sub LoadTaggedIMG()
|
||||
Dim ID As String = pub_aPhotos(pub_nPhotoIndex)
|
||||
Dim iTaggedIMG As New TaggedIMG
|
||||
If ID <> "" Then 'Später wird die ID der DB übergeben
|
||||
|
||||
SaveTaggByEvent()
|
||||
|
||||
iTaggedIMG = Modul_SB_PictureTagger.LoadPicture(ID)
|
||||
Label7.Text = iTaggedIMG.Path
|
||||
'Befülle PictureBox
|
||||
PictureBox1.Image = iTaggedIMG.Image
|
||||
|
||||
'Textvelder Lehren
|
||||
Clear()
|
||||
|
||||
'Befülle TextBox
|
||||
tb_Bild_Time.Text = iTaggedIMG.Time
|
||||
tb_Bild_Title.Text = iTaggedIMG.Title
|
||||
tb_Place_Addresse.Text = iTaggedIMG.Ort.Adresse
|
||||
tb_Place_GPS.Text = iTaggedIMG.Ort.GPS
|
||||
rtb_Bild_Description.Text = iTaggedIMG.Description
|
||||
rtb_Place_Description.Text = iTaggedIMG.Ort.Description
|
||||
|
||||
'End Sub
|
||||
|
||||
'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
|
||||
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
|
||||
pub_sPath = Modul_Tools.FolderBrowserDialog()
|
||||
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
|
||||
If pub_bChangeTagg = True Then
|
||||
SaveTagg()
|
||||
End If
|
||||
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
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### TextBox: TextCanched ##############################################################################
|
||||
'###################################################################################################################
|
||||
Private Sub rtb_Bild_Description_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtb_Bild_Description.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
Private Sub rtb_Place_Description_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtb_Place_Description.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
Private Sub tb_Bild_Time_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Bild_Time.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
Private Sub tb_Bild_Title_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Bild_Title.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
Private Sub tb_Place_Addresse_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Place_Addresse.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
Private Sub tb_Place_GPS_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_Place_GPS.TextChanged
|
||||
pub_bChangeTagg = True
|
||||
End Sub
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### CheckBox Events: CheckStateChanged ################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Private Sub cb_marks_visible_CheckStateChanged(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
'Wenn cb_marks_visible=true then ZeichneMarks() ELSE VerstekeMarks()
|
||||
End Sub
|
||||
|
||||
End Class
|
221
SB-PictureTagger/M_SB_PictureTagger.vb
Normal file
221
SB-PictureTagger/M_SB_PictureTagger.vb
Normal file
@ -0,0 +1,221 @@
|
||||
Option Explicit On
|
||||
Imports SB_PictureTagger.Stammbaum
|
||||
Namespace Stammbaum.Module.PictureTagger
|
||||
Module PictureTagger
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Lade ##############################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Public Sub PT_LoadVerzeichnis()
|
||||
If System.IO.Directory.Exists(Settings.PictureTagger.Pub_sPath) Then
|
||||
Settings.PictureTagger.pub_aPfade = Tools.Filesystem.GetFilesFromDir(Settings.PictureTagger.Pub_sPath, Settings.PictureTagger.pub_aSupportedFiles, Settings.PictureTagger.nOrdnerTiefe)
|
||||
End If
|
||||
End Sub 'Lade Bilder in pub_aPfade Array
|
||||
|
||||
Public Sub PT_LoadTaggedIMG()
|
||||
'Absicherung für Undimensioniertes Array
|
||||
If Settings.PictureTagger.pub_aPfade.Length = 0 Then ReDim Settings.PictureTagger.pub_aPfade(0)
|
||||
|
||||
'Bildpfad auf existenz Prüfen
|
||||
If System.IO.File.Exists(Settings.PictureTagger.pub_aPfade(Settings.PictureTagger.pub_nPfadeIndex)) Then
|
||||
|
||||
'Taggs With INI:
|
||||
Settings.PictureTagger.Pub_oLoaded_TaggedIMG = INI_Load_Taggs(Settings.PictureTagger.pub_aPfade(Settings.PictureTagger.pub_nPfadeIndex), False)
|
||||
|
||||
'Later With DB ---
|
||||
|
||||
End If
|
||||
End Sub 'Lade TaggedIMG in Pub_oLoaded_TaggedIMG
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Speichere #########################################################################################
|
||||
'###################################################################################################################
|
||||
Public Sub PT_SaveTaggedIMG()
|
||||
|
||||
'Taggs With INI:
|
||||
INI_Save_Taggs(Settings.PictureTagger.Pub_oLoaded_TaggedIMG, False)
|
||||
|
||||
'Later With DB ---
|
||||
End Sub
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Taggs With INI ####################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
'Taggs auslesen (jezt noch aus INI - später aus DB)
|
||||
Private Function INI_Load_Taggs(ByVal PicturePath As String, Optional ByVal ForEachDat As Boolean = False) As Classen.PictureTagger.TaggedIMG
|
||||
'### INI Einstellungen ###
|
||||
Dim INI_Locate As String
|
||||
Dim INI_Name As String
|
||||
|
||||
If ForEachDat Then
|
||||
INI_Name = System.IO.Path.Combine(System.IO.Path.GetFileName(PicturePath), ".ini")
|
||||
INI_Locate = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PicturePath), INI_Name)
|
||||
Else
|
||||
INI_Name = "Tagg.ini"
|
||||
INI_Locate = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PicturePath), INI_Name)
|
||||
End If
|
||||
|
||||
'### Main ##
|
||||
Dim TMP_TaggIMG As New Classen.PictureTagger.TaggedIMG
|
||||
If System.IO.File.Exists(PicturePath) Then
|
||||
|
||||
'Lade Wichtigste Eigenschaften = Immer Forhanden bei Geladenem TaggedIMG
|
||||
TMP_TaggIMG.Image = Image.FromFile(PicturePath)
|
||||
TMP_TaggIMG.Path = PicturePath
|
||||
TMP_TaggIMG.ID = System.IO.Path.GetFileName(PicturePath)
|
||||
|
||||
If System.IO.File.Exists(INI_Locate) Then
|
||||
'Deklarationen
|
||||
Dim i As Long
|
||||
Dim sKey As String = TMP_TaggIMG.ID
|
||||
|
||||
'Führ Makr einlese Schleife
|
||||
Dim Mark_ID As String
|
||||
Dim Mark_PositionX As Long
|
||||
Dim Mark_PositionY As Long
|
||||
Dim Mark_Radius As Long
|
||||
Dim Mark_Description As String
|
||||
Dim Mark_Index As String
|
||||
|
||||
|
||||
'Lade Optionalen Rest:
|
||||
'Titel
|
||||
TMP_TaggIMG.Title = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Title", Nothing)
|
||||
'Kurzbeschreibung
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Description"
|
||||
TMP_TaggIMG.Description = Tools.Convert.Coding.Base64_To_Ascii(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Zeitangabe
|
||||
TMP_TaggIMG.Time = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Time", Nothing)
|
||||
'Ortsangabe-Title
|
||||
TMP_TaggIMG.Ort.Title = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Place_Title", Nothing)
|
||||
'Ortsangabe-Adresse
|
||||
TMP_TaggIMG.Ort.Adresse = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Place_Adresse", Nothing)
|
||||
'Ortsangabe-Kurzbeschreibung
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Place.Description"
|
||||
TMP_TaggIMG.Ort.Description = Tools.Convert.Coding.Base64_To_Ascii(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Place_Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Ortsangabe-GPS Koordinaten
|
||||
TMP_TaggIMG.Ort.GPS = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Place_GPS", Nothing)
|
||||
|
||||
|
||||
|
||||
|
||||
'Load Marks
|
||||
'sMark_Index = Modul_Tools.Config_INI_ReadValue(INI_Locate, ID, "Title")
|
||||
i = 0
|
||||
Do While i <= 200
|
||||
Mark_Index = ("Mark" & Convert.ToString(i) & "_ID")
|
||||
Mark_ID = Tools.Data.File.INI_ReadValue(INI_Locate, sKey, Mark_Index)
|
||||
If Mark_ID <> "" Then
|
||||
i += 1
|
||||
|
||||
Mark_PositionX = Convert.ToDouble(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Mark" & Convert.ToString(i) & "_PositionX", "0"))
|
||||
Mark_PositionY = Convert.ToInt32(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Mark" & Convert.ToString(i) & "_PositionY", "0"))
|
||||
Mark_Radius = Convert.ToInt32(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Mark" & Convert.ToString(i) & "_Radius", "0"))
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Mark_Description"
|
||||
Mark_Description = Tools.Convert.Coding.Base64_To_Ascii(Tools.Data.File.INI_ReadValue(INI_Locate, sKey, "Mark" & Convert.ToString(i) & "_Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Erstellen eines Neuen Marks
|
||||
TMP_TaggIMG.Create_NewMark(Mark_ID, Mark_PositionX, Mark_PositionY, Mark_Radius, Mark_Description)
|
||||
Else
|
||||
'Verlasse Schleife
|
||||
Exit Do
|
||||
End If
|
||||
Loop
|
||||
|
||||
|
||||
|
||||
|
||||
End If 'File.Exists(INI_Locate)
|
||||
End If 'File.Exists(PicturePath)
|
||||
INI_Load_Taggs = TMP_TaggIMG
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub INI_Save_Taggs(ByVal oTaggedIMG As Classen.PictureTagger.TaggedIMG, Optional ByVal ForEachDat As Boolean = False)
|
||||
|
||||
'### INI Einstellungen ###
|
||||
Dim INI_Locate As String
|
||||
Dim INI_Name As String
|
||||
Dim PicturePath As String = oTaggedIMG.Path
|
||||
|
||||
If ForEachDat Then
|
||||
INI_Name = System.IO.Path.Combine(System.IO.Path.GetFileName(PicturePath), ".ini")
|
||||
INI_Locate = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PicturePath), INI_Name)
|
||||
Else
|
||||
INI_Name = "Tagg.ini"
|
||||
INI_Locate = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PicturePath), INI_Name)
|
||||
End If
|
||||
|
||||
Dim i As Long
|
||||
'### Main ##
|
||||
If System.IO.File.Exists(PicturePath) Then
|
||||
If Not System.IO.File.Exists(INI_Locate) Then System.IO.File.Create(INI_Locate)
|
||||
|
||||
'Deklarationen
|
||||
Dim sKey = oTaggedIMG.ID
|
||||
|
||||
'Titel
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Title", oTaggedIMG.Title)
|
||||
|
||||
'Kurzbeschreibung
|
||||
'##############################################################
|
||||
'Formate Description Text from "Description"
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Description", Tools.Convert.Coding.Ascii_To_Base64(oTaggedIMG.Description))
|
||||
'##############################################################
|
||||
|
||||
'Zeitangabe
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Time", oTaggedIMG.Time)
|
||||
'Ortsangabe-Title
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Place_Title", oTaggedIMG.Ort.Title)
|
||||
'Ortsangabe-Adresse
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Place_Adresse", oTaggedIMG.Ort.Adresse)
|
||||
|
||||
'Ortsangabe-Kurzbeschreibung
|
||||
'##############################################################
|
||||
'Formate Description Text from "TMP_TaggIMG.Place.Description"
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Place_Description", Tools.Convert.Coding.Ascii_To_Base64(oTaggedIMG.Ort.Description))
|
||||
'##############################################################
|
||||
|
||||
'Ortsangabe-GPS Koordinaten
|
||||
Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Place_GPS", oTaggedIMG.Ort.GPS)
|
||||
|
||||
|
||||
'Save Marks ############### wird noch geändert ############### <--
|
||||
'i = 0
|
||||
'If oTaggedIMG.Markierung(0).ID <> "" Then
|
||||
' For i = 0 To UBound(oTaggedIMG.Markierung)
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark" & i & "_ID", Convert.ToString(i))
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark" & i & "_PositionX", Convert.ToString(oTaggedIMG.Markierung(i).PositionX))
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark" & i & "_PositionY", Convert.ToString(oTaggedIMG.Markierung(i).PositionY))
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark" & i & "_Radius", Convert.ToString(oTaggedIMG.Markierung(i).Radius))
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark" & i & "_Description", Tools.Convert.Coding.Ascii_To_Base64(oTaggedIMG.Markierung(i).Description))
|
||||
|
||||
' 'Schreibe Begrenzung
|
||||
' Tools.Data.File.INI_WriteValue(INI_Locate, sKey, "Mark_MaxIndex", i)
|
||||
|
||||
' Next i
|
||||
'End If
|
||||
|
||||
End If 'File.Exists(PicturePath)
|
||||
End Sub
|
||||
|
||||
'###################################################################################################################
|
||||
'############### Taggs With DB #####################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
|
||||
|
||||
End Module 'PictureTagger
|
||||
End Namespace 'Stammbaum.Module.PictureTagger
|
355
SB-PictureTagger/M_Tools.vb
Normal file
355
SB-PictureTagger/M_Tools.vb
Normal file
@ -0,0 +1,355 @@
|
||||
Namespace Tools
|
||||
Namespace Filesystem
|
||||
Module Filesystem
|
||||
|
||||
'######################################################################################
|
||||
'################Function GetFilesFromDir(Pfad; Extention; RecursionsTiefe)############
|
||||
Public Function GetFilesFromDir(ByVal Pfad As String, ByVal Extention() As String, Optional ByVal RecursionsTiefe As Integer = 0) As String()
|
||||
|
||||
If Extention.Length <= 0 Then ReDim Extention(0)
|
||||
If Extention(0) = Nothing Then Extention(0) = ""
|
||||
|
||||
Dim aPathList(0) As String
|
||||
Dim aPathList_Extention(0) As String
|
||||
|
||||
'Überprüfen auf Pfad Korektheit
|
||||
If System.IO.Directory.Exists(Pfad) Then
|
||||
|
||||
'Auslesen der Ordner
|
||||
_GetFilesFromDir(aPathList, Pfad, RecursionsTiefe)
|
||||
If aPathList.Length <= 0 Then ReDim aPathList(0)
|
||||
|
||||
'Extention Rausfiltern
|
||||
If Not (Array.IndexOf(Extention, "*") >= 0) Then
|
||||
For Each EachFile In aPathList
|
||||
If (Array.IndexOf(Extention, System.IO.Path.GetExtension(EachFile)) >= 0) Then
|
||||
'Undimensionierte Arrays werden Dimensioniert
|
||||
If aPathList_Extention.Length <= 0 Then ReDim aPathList_Extention(0)
|
||||
|
||||
'Wenn Letzter Wert Im Array nicht vergeben ist
|
||||
If (aPathList_Extention(UBound(aPathList_Extention)) = Nothing) Or (aPathList_Extention(UBound(aPathList_Extention)) = "") Then
|
||||
aPathList_Extention(UBound(aPathList_Extention)) = EachFile
|
||||
Else
|
||||
'Wenn Letzter Wert Im Array ist vergeben!
|
||||
ReDim Preserve aPathList_Extention(UBound(aPathList_Extention) + 1)
|
||||
aPathList_Extention(UBound(aPathList_Extention)) = EachFile
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
aPathList_Extention = aPathList
|
||||
End If
|
||||
|
||||
'Array Sortieren
|
||||
Array.Sort(aPathList_Extention)
|
||||
|
||||
Else
|
||||
aPathList_Extention(0) = Nothing
|
||||
End If
|
||||
GetFilesFromDir = aPathList_Extention
|
||||
End Function
|
||||
|
||||
Private Sub _GetFilesFromDir(ByRef aAim As String(), ByVal Pfad As String, ByVal RecursionsTiefe As Integer)
|
||||
Try 'Um das Zugrifsrecht Problem zu Beseitigen
|
||||
If RecursionsTiefe > 0 Then
|
||||
Dim aDirs As String() = System.IO.Directory.GetDirectories(Pfad)
|
||||
For Each EachDir In aDirs
|
||||
_GetFilesFromDir(aAim, EachDir, (RecursionsTiefe - 1))
|
||||
Next
|
||||
End If
|
||||
Dim aFiles As String() = System.IO.Directory.GetFiles(Pfad)
|
||||
|
||||
For Each EachFile In aFiles
|
||||
If aAim.Length <= 0 Then ReDim aAim(0)
|
||||
If (aAim(UBound(aAim)) = Nothing) Or (aAim(UBound(aAim)) = "") Then
|
||||
aAim(UBound(aAim)) = EachFile
|
||||
Else
|
||||
ReDim Preserve aAim(UBound(aAim) + 1)
|
||||
aAim(UBound(aAim)) = EachFile
|
||||
End If
|
||||
Next
|
||||
Catch err As Exception
|
||||
End Try
|
||||
End Sub 'Teil von Finction GetFilesFromDir
|
||||
'######################################################################################
|
||||
'######################################################################################
|
||||
|
||||
'### 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 'FileExists Vor VBA AND VB without .Net
|
||||
|
||||
'### 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 'DirExists Vor VBA AND VB without .Net
|
||||
'######################################################################################
|
||||
'######################################################################################
|
||||
|
||||
End Module
|
||||
End Namespace 'Filesystem
|
||||
Namespace Dialoge
|
||||
Module Dialoge
|
||||
|
||||
Public Function FolderBrowserDialog(Optional ByVal sStartPath As String = "C:\", Optional ByVal ShowNewFolderButton As Boolean = True, Optional ByRef CheckError As Boolean = False) As String
|
||||
'Verändert die übergebene variable,
|
||||
'wenn der benutzer durch "OK" den neuen Pfad bestätigt
|
||||
FolderBrowserDialog = ""
|
||||
Using FolderBrowserD As New FolderBrowserDialog
|
||||
With FolderBrowserD
|
||||
' Ordnervorschlag
|
||||
.SelectedPath = sStartPath
|
||||
|
||||
.Description = "Bitte einen Ordner auswählen."
|
||||
|
||||
'#Button "Neuen Ordner erstellen" anzeigen
|
||||
.ShowNewFolderButton = ShowNewFolderButton
|
||||
|
||||
'#ruft Dialog auf, weitere Ausführung nur bei Resultat "OK"
|
||||
If .ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
FolderBrowserDialog = .SelectedPath
|
||||
Else
|
||||
CheckError = True '#Ausführung bei Abruch
|
||||
End If
|
||||
End With 'FolderBrowserD
|
||||
End Using
|
||||
End Function 'FolderBrowserDialog
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 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
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 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
|
||||
|
||||
End Module
|
||||
End Namespace 'Dialoge (Ordner Öffnen, Datei Öffnen, Datei Speichern, Ja/Nein, ...
|
||||
Namespace Convert
|
||||
Namespace Numeral_System
|
||||
'Gehört noch Proggramiert (Hex - Dezi - Dual - Römisch - ...)
|
||||
End Namespace 'Numeral_System (Hex - Dezi - Dual - Römisch - ...) in work
|
||||
Namespace Coding
|
||||
Module Coding
|
||||
'######################################################################################
|
||||
'##################################Ascii AND Base64####################################
|
||||
'Ascii to Base64
|
||||
Public Function Ascii_To_Base64(ByVal AsciiString As String) As String
|
||||
Dim base64encoded As String = vbNull
|
||||
Dim raw As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(AsciiString)
|
||||
base64encoded = System.Convert.ToBase64String(raw)
|
||||
Ascii_To_Base64 = base64encoded
|
||||
End Function
|
||||
'Base64 to Ascii
|
||||
Public Function Base64_To_Ascii(ByVal Base64String As String) As String
|
||||
Try
|
||||
Dim raw As Byte() = System.Convert.FromBase64String(Base64String)
|
||||
Base64_To_Ascii = System.Text.ASCIIEncoding.ASCII.GetString(raw)
|
||||
Catch ex As Exception
|
||||
Base64_To_Ascii = ""
|
||||
End Try
|
||||
End Function
|
||||
'######################################################################################
|
||||
'######################################################################################
|
||||
End Module 'Coding
|
||||
End Namespace 'Coding (Ascii, Base64, Dual<-in work, ...)
|
||||
Namespace Koordinaten
|
||||
Module Koordinaten
|
||||
'Soll anhand der GPS Koordinaten GoogleMaps öfnen
|
||||
'URL ansteuerung: https://developers.google.com/maps/documentation/staticmaps/
|
||||
' String = "52.520817 13.40945"
|
||||
'
|
||||
'Umrechnung von Geo-Koordinaten: http://rechneronline.de/geo-koordinaten/
|
||||
' ___________________________________________________________________________________________________
|
||||
'| Grad, Minuten, Sekunden | Dezimalgrad | Grad, Dezimalminuten |
|
||||
'| z.B. N52° 31' 14.941" E13° 24' 34.020" | z.B. 52.520817 13.40945 | z.B. N52° 31.249 E13° 24.567 |
|
||||
' ---------------------------------------------------------------------------------------------------
|
||||
' URL= "http://maps.google.com/maps?q=" & String
|
||||
'In Projekt SB-PictureTagger: Set a LincLable ;)
|
||||
End Module 'Koordinaten
|
||||
End Namespace 'Koordinaten (GPS einheiten, MapsURLs,...)
|
||||
End Namespace 'Convert
|
||||
Namespace Prog_Org
|
||||
Module Prog_Org
|
||||
'######################################################################################
|
||||
'############################## PORTABLE MODE TOOLS ###################################
|
||||
'Festlegung ob Portable oder nicht, ...
|
||||
Public Function PortableModeTrue(ByVal ConfigFileName As String) As Boolean
|
||||
If System.IO.File.Exists(".\" & ConfigFileName) Then
|
||||
PortableModeTrue = True
|
||||
Else
|
||||
PortableModeTrue = False
|
||||
End If
|
||||
|
||||
End Function 'PortableModeTrue
|
||||
'PortableMode:
|
||||
'Übergabe: ConfigFile [WorkDir] [AppName] Return: (PortableMode=True/False)
|
||||
'ConfigFile Nahme und Extendion - Wird Indirekt Geändert zu KonfigPfad
|
||||
'WorkDir Pfad des Arbeitsverzeichnises - Wird Indirekt Geändert
|
||||
'AppName Erstellt einen Neuern Ordner mit Diesen Nahme, wenn Nicht Portabler Mode
|
||||
Public Function PortableMode(ByRef ConfigFile As String, Optional ByRef WorkDir As String = "-default-", Optional ByVal AppName As String = "-default-") As Boolean
|
||||
If AppName = ("-default-" Or "") Then
|
||||
AppName = Application.ProductName
|
||||
End If
|
||||
If Not System.IO.Directory.Exists(WorkDir) Then WorkDir = "-default-"
|
||||
If WorkDir = ("-default-" Or "") Then
|
||||
WorkDir = Application.StartupPath
|
||||
End If
|
||||
|
||||
If System.IO.File.Exists(System.IO.Path.Combine(WorkDir, ConfigFile)) Then
|
||||
PortableMode = True
|
||||
ConfigFile = System.IO.Path.Combine(WorkDir, ConfigFile)
|
||||
Else
|
||||
PortableMode = False
|
||||
WorkDir = Environment.GetEnvironmentVariable("APPDATA") & "\" & AppName
|
||||
If Not System.IO.Directory.Exists(WorkDir) Then System.IO.Directory.CreateDirectory(WorkDir)
|
||||
ConfigFile = System.IO.Path.Combine(WorkDir, ConfigFile)
|
||||
If Not System.IO.File.Exists(ConfigFile) Then System.IO.File.Create(ConfigFile)
|
||||
End If
|
||||
|
||||
End Function 'PortableMode
|
||||
'######################################################################################
|
||||
'######################################################################################
|
||||
End Module
|
||||
End Namespace 'Prog_Org
|
||||
Namespace Data
|
||||
Namespace DB
|
||||
'Verschiedenen DBs mit ihren Befehlen
|
||||
End Namespace 'DBs (SQLite, SQL, MySQL, ...)
|
||||
Namespace File
|
||||
Module File
|
||||
'Declaration für INI:
|
||||
Private Declare Ansi Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32
|
||||
Private Declare Ansi Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Int32
|
||||
|
||||
Public Function INI_ReadValue(ByVal sFilePath As String, ByVal sSection As String, ByVal sKey As String, Optional ByVal sDefault As String = "") As String
|
||||
Dim strTemp As String = Space(1024), lLength As Integer
|
||||
lLength = GetPrivateProfileString(sSection, sKey, sDefault, strTemp, strTemp.Length, sFilePath)
|
||||
Return (strTemp.Substring(0, lLength))
|
||||
End Function 'Read a INI
|
||||
Public Function INI_WriteValue(ByVal sFilePath As String, ByVal sSection As String, ByVal sKey As String, ByVal sValue As String) As Boolean
|
||||
Return (Not (WritePrivateProfileString(sSection, sKey, sValue, sFilePath) = 0))
|
||||
End Function 'Write a INI
|
||||
|
||||
End Module
|
||||
End Namespace 'File (INI, XML, ...)
|
||||
End Namespace 'Data = Manage Infos (DBs, Files, ...)
|
||||
End Namespace 'Tools
|
@ -1,353 +0,0 @@
|
||||
Option Explicit On
|
||||
Imports System.IO
|
||||
|
||||
Module Modul_SB_PictureTagger
|
||||
Structure Mark
|
||||
Dim PositionX As Long
|
||||
Dim PositionY As Long
|
||||
Dim ID As Long
|
||||
Dim Radius As Long
|
||||
Dim Description As String
|
||||
End Structure 'Mark
|
||||
Structure Place
|
||||
Dim Title As String
|
||||
Dim Adresse As String
|
||||
Dim Description As String
|
||||
Dim GPS As String
|
||||
Public Sub Clear()
|
||||
Me.Adresse = Nothing
|
||||
Me.Description = Nothing
|
||||
Me.GPS = Nothing
|
||||
End Sub
|
||||
End Structure
|
||||
Structure TaggedIMG
|
||||
Dim ID As String
|
||||
Dim Title As String
|
||||
Dim Description As String
|
||||
Dim Time As String
|
||||
Dim Markierung() As Mark
|
||||
Dim Image As Image
|
||||
Dim Ort As Place
|
||||
Dim Path As String
|
||||
Public Sub Create_NewMark(ByVal ID As Long, ByVal PositionX As Long, ByVal PositionY As Long, Optional ByVal Radius As Long = 10, Optional ByVal Description As String = "")
|
||||
'Dim Index As Integer
|
||||
'If Array.IndexOf(Me.Mark, ) Then Index = 1 + UBound(Me.Mark)
|
||||
'ReDim Me.Mark(Index)
|
||||
'Me.Mark(Index).ID = ID
|
||||
'Me.Mark(Index).PositionX = PositionX
|
||||
'Me.Mark(Index).PositionY = PositionY
|
||||
'Me.Mark(Index).Radius = Radius
|
||||
'Me.Mark(Index).Description = Description
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Clear()
|
||||
Me.ID = Nothing
|
||||
Me.Image = Nothing
|
||||
Me.Title = Nothing
|
||||
Me.Description = Nothing
|
||||
Me.Time = Nothing
|
||||
Me.Path = Nothing
|
||||
Me.Ort.Clear()
|
||||
ReDim Me.Markierung(0)
|
||||
Me.Markierung(0).Description = Nothing
|
||||
Me.Markierung(0).PositionX = Nothing
|
||||
Me.Markierung(0).PositionY = Nothing
|
||||
Me.Markierung(0).ID = Nothing
|
||||
Me.Markierung(0).Radius = Nothing
|
||||
End Sub
|
||||
|
||||
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
|
||||
'3.Load_Taggs
|
||||
' Parameter: TaggedIMG-Objekt, DB_Locate -> Indirekte änderung des TaggedIMG-Objekts
|
||||
'4.Save_Taggs
|
||||
' Parameter: TaggedIMG-Objekt, DB_Locate
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 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
|
||||
Dim iPicture_Verz As String
|
||||
|
||||
'Testen ob Vormat unterstüzt!
|
||||
If (Array.IndexOf(aPhotoFormats, IO.Path.GetExtension(sPath))) >= 0 Then
|
||||
iPicture_Verz = IO.Path.GetDirectoryName(sPath)
|
||||
iPicture.Path = sPath
|
||||
iPicture.Image = Image.FromFile(sPath)
|
||||
iPicture.ID = IO.Path.GetFileName(sPath)
|
||||
|
||||
'Wen Forhanden Exif infos lesen und eintragen (werden von DB überschrieben, wenn dor ein Wert vorhanden ist)
|
||||
|
||||
'Wird hier mit Tagg Bestückt!
|
||||
' iPicture_Verz wird zum localisieren der INI benötigt
|
||||
Load_Taggs(iPicture, iPicture_Verz)
|
||||
|
||||
|
||||
LoadPicture = iPicture
|
||||
Else
|
||||
MsgBox("Unsupported Format!")
|
||||
LoadPicture = ""
|
||||
End If
|
||||
'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)
|
||||
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
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 3.Load_Taggs ###################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
|
||||
'Taggs auslesen (jezt noch aus INI - später aus DB)
|
||||
Private Sub Load_Taggs(ByRef iPicture As TaggedIMG, ByVal DB_Locate As String)
|
||||
'Grund Vars Deklarieren
|
||||
Dim ID As String = iPicture.ID
|
||||
Dim sDB As String = "Tagg.ini"
|
||||
Dim i As Long
|
||||
|
||||
|
||||
sDB = Path.Combine(DB_Locate, sDB)
|
||||
If File.Exists(sDB) And ID <> "" Then
|
||||
'Dekalriere
|
||||
Dim Mark_ID As String
|
||||
Dim Mark_PositionX As Long
|
||||
Dim Mark_PositionY As Long
|
||||
Dim Mark_Radius As Long
|
||||
Dim Mark_Description As String
|
||||
Dim Mark_Index As String
|
||||
|
||||
'Titel
|
||||
iPicture.Title = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Title", Nothing)
|
||||
'Kurzbeschreibung
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Description"
|
||||
iPicture.Description = Modul_Tools.Base64_To_Ascii(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Zeitangabe
|
||||
iPicture.Time = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Time", Nothing)
|
||||
'Ortsangabe-Title
|
||||
iPicture.Ort.Title = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Place_Title", Nothing)
|
||||
'Ortsangabe-Adresse
|
||||
iPicture.Ort.Adresse = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Place_Adresse", Nothing)
|
||||
'Ortsangabe-Kurzbeschreibung
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Place.Description"
|
||||
iPicture.Ort.Description = Modul_Tools.Base64_To_Ascii(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Place_Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Ortsangabe-GPS Koordinaten
|
||||
iPicture.Ort.GPS = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Place_GPS", Nothing)
|
||||
|
||||
|
||||
'Load Marks
|
||||
'sMark_Index = Modul_Tools.Config_INI_ReadValue(sDB, ID, "Title")
|
||||
i = 0
|
||||
Do While i <= 200
|
||||
Mark_Index = ("Mark" & Convert.ToString(i) & "_ID")
|
||||
Mark_ID = Modul_Tools.Config_INI_ReadValue(sDB, ID, Mark_Index)
|
||||
If Mark_ID <> "" Then
|
||||
i += 1
|
||||
|
||||
Mark_PositionX = Convert.ToDouble(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Mark" & Convert.ToString(i) & "_PositionX", "0"))
|
||||
Mark_PositionY = Convert.ToInt32(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Mark" & Convert.ToString(i) & "_PositionY", "0"))
|
||||
Mark_Radius = Convert.ToInt32(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Mark" & Convert.ToString(i) & "_Radius", "0"))
|
||||
'##############################################################
|
||||
'ReFormate Description Text from "Mark_Description"
|
||||
Mark_Description = Modul_Tools.Base64_To_Ascii(Modul_Tools.Config_INI_ReadValue(sDB, ID, "Mark" & Convert.ToString(i) & "_Description", Nothing))
|
||||
'##############################################################
|
||||
|
||||
'Erstellen eines Neuen Marks
|
||||
iPicture.Create_NewMark(Mark_ID, Mark_PositionX, Mark_PositionY, Mark_Radius, Mark_Description)
|
||||
Else
|
||||
'Verlasse Schleife
|
||||
Exit Do
|
||||
End If
|
||||
Loop
|
||||
i = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 4.Save_Taggs ###################################################################################
|
||||
'###################################################################################################################
|
||||
Public Sub Save_Taggs(ByVal iPicture As TaggedIMG, ByVal DB_Locate As String)
|
||||
'Grund Vars Deklarieren
|
||||
Dim ID As String = iPicture.ID
|
||||
Dim sDB As String = "Tagg.ini"
|
||||
Dim i As Long
|
||||
|
||||
sDB = Path.Combine(DB_Locate, sDB)
|
||||
If (ID <> "") And (Not File.Exists(sDB)) Then
|
||||
File.Create(sDB)
|
||||
|
||||
'Titel
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Title", iPicture.Title)
|
||||
|
||||
'Kurzbeschreibung
|
||||
'##############################################################
|
||||
'Formate Description Text from "Description"
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Description", Modul_Tools.Ascii_To_Base64(iPicture.Description))
|
||||
'##############################################################
|
||||
|
||||
'Zeitangabe
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Time", iPicture.Time)
|
||||
'Ortsangabe-Title
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Place_Title", iPicture.Ort.Title)
|
||||
'Ortsangabe-Adresse
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Place_Adresse", iPicture.Ort.Adresse)
|
||||
|
||||
'Ortsangabe-Kurzbeschreibung
|
||||
'##############################################################
|
||||
'Formate Description Text from "iPicture.Place.Description"
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Place_Description", Modul_Tools.Ascii_To_Base64(iPicture.Ort.Description))
|
||||
'##############################################################
|
||||
|
||||
'Ortsangabe-GPS Koordinaten
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Place_GPS", iPicture.Ort.GPS)
|
||||
|
||||
|
||||
'Save Marks
|
||||
i = 0
|
||||
If iPicture.Markierung(0).ID <> "" Then
|
||||
For i = 0 To UBound(iPicture.Markierung)
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Mark" & i & "_ID", Convert.ToString(i))
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Mark" & i & "_PositionX", Convert.ToString(iPicture.Markierung(i).PositionX))
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Mark" & i & "_PositionY", Convert.ToString(iPicture.Markierung(i).PositionY))
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Mark" & i & "_Radius", Convert.ToString(iPicture.Markierung(i).Radius))
|
||||
Modul_Tools.Config_INI_WriteValue(sDB, ID, "Mark" & i & "_Description", Modul_Tools.Ascii_To_Base64(iPicture.Markierung(i).Description))
|
||||
Next i
|
||||
End If
|
||||
i = 0
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'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
|
@ -1,313 +0,0 @@
|
||||
Option Explicit On
|
||||
Imports System.IO
|
||||
|
||||
Module Modul_Tools
|
||||
|
||||
'Methonden_Index:
|
||||
'1.Datei- und Ordnerdialoge
|
||||
' 1.1 FolderBrowserDialog <-- in Work (Main works)
|
||||
' 1.2 OpenFileDialog <-- in Work (Don't work)
|
||||
' 1.3 SaveFileDialog <-- in Work
|
||||
|
||||
'2.Config Load/Save
|
||||
' 2.1 From INI
|
||||
' 2.1.1 Config_INI_ReadValue
|
||||
' 2.1.2 Config_INI_WriteValue
|
||||
' ExampleConf = Config_INI_ReadValue(FilePath, Section, Key, [DefaultWert])
|
||||
' [Error =] Config_INI_WriteValue(FilePath, Section, Key, Wert)
|
||||
' 2.2 From My CMD seting Files
|
||||
|
||||
'3.PortableMode
|
||||
' 3.1 PortableModeTrue
|
||||
' Übergabe: ConfigFile Return: (PortableMode=True/False)
|
||||
' 3.2 PortableMode
|
||||
' Übergabe: ConfigFile [WorkDir] [AppName] Return: (PortableMode=True/False)
|
||||
' ConfigFile Nahme und Extendion - Wird Indirekt Geändert zu KonfigPfad
|
||||
' WorkDir Pfad des Arbeitsverzeichnises - Wird Indirekt Geändert
|
||||
' AppName Erstellt einen Neuern Ordner mit Diesen Nahme, wenn Nicht Portabler Mode
|
||||
|
||||
'4.GPS_Tools
|
||||
' 4.1 GPS_to_GMaps
|
||||
|
||||
'5.Ascii<->Base64
|
||||
' 5.1 Ascii_To_Base64
|
||||
' 5.2 Base64_To_Ascii
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 1.Datei- und Ordnerdialoge ########################################################################
|
||||
'############### http://www.vb-fun.de/dotnet/tipps/tip0212.shtml ###################################################
|
||||
'###################################################################################################################
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 1.1 FolderBrowserDialog ###########################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
Public Function FolderBrowserDialog(Optional ByVal sStartPath As String = "C:\", Optional ByVal ShowNewFolderButton As Boolean = True, Optional ByRef CheckError As Boolean = False) As String
|
||||
'Verändert die übergebene variable,
|
||||
'wenn der benutzer durch "OK" den neuen Pfad bestätigt
|
||||
FolderBrowserDialog = ""
|
||||
Using FolderBrowserD As New FolderBrowserDialog
|
||||
With FolderBrowserD
|
||||
' Ordnervorschlag
|
||||
.SelectedPath = sStartPath
|
||||
|
||||
.Description = "Bitte einen Ordner auswählen."
|
||||
|
||||
'#Button "Neuen Ordner erstellen" anzeigen
|
||||
.ShowNewFolderButton = ShowNewFolderButton
|
||||
|
||||
'#ruft Dialog auf, weitere Ausführung nur bei Resultat "OK"
|
||||
If .ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
FolderBrowserDialog = .SelectedPath
|
||||
Else
|
||||
CheckError = True '#Ausführung bei Abruch
|
||||
End If
|
||||
End With 'FolderBrowserD
|
||||
End Using
|
||||
End Function '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
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 2.Config Load/Save ################################################################################
|
||||
'############### Methonden für Laden von Variablen aus DB;INI,... ##################################################
|
||||
'###################################################################################################################
|
||||
' 2.1 From INI
|
||||
' 2.1.1 Config_INI_ReadValue
|
||||
' 2.1.2 Config_INI_WriteValue
|
||||
' 2.2 From My CMD seting Files
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 2.1 Config_From_INI ###############################################################################
|
||||
'###################################################################################################################
|
||||
'FamExample = Config_INI_ReadValue(FilePath, Section, Key, [""])
|
||||
'Config_INI_WriteValue(FilePath, Section, Key, Wert)
|
||||
|
||||
Private Declare Ansi Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32
|
||||
Private Declare Ansi Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Int32
|
||||
|
||||
Public Function Config_INI_ReadValue(ByVal sFilePath As String, ByVal sSection As String, ByVal sKey As String, Optional ByVal sDefault As String = "") As String
|
||||
Dim strTemp As String = Space(1024), lLength As Integer
|
||||
lLength = GetPrivateProfileString(sSection, sKey, sDefault, strTemp, strTemp.Length, sFilePath)
|
||||
Return (strTemp.Substring(0, lLength))
|
||||
End Function
|
||||
Public Function Config_INI_WriteValue(ByVal sFilePath As String, ByVal sSection As String, ByVal sKey As String, ByVal sValue As String) As Boolean
|
||||
Return (Not (WritePrivateProfileString(sSection, sKey, sValue, sFilePath) = 0))
|
||||
End Function
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 2.2 Config_From_My-CMD-File #######################################################################
|
||||
'###################################################################################################################
|
||||
'Syntax der Datei:
|
||||
'Variable1 = Wertxy
|
||||
'Variable2 = Zahtl2
|
||||
'...
|
||||
'Alles in String (Mussa auf zahl Überprüft werden und dan DeDim as Integer ...)
|
||||
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 3.PortableMode ####################################################################################
|
||||
'############### Veststellen ob Portable und deren Eigenarten ######################################################
|
||||
'###################################################################################################################
|
||||
' 3.1 3.PortableModeTrue
|
||||
'Festlegung ob Portable oder nicht
|
||||
Public Function PortableModeTrue(ByVal ConfigFileName As String) As Boolean
|
||||
If File.Exists(".\" & ConfigFileName) Then
|
||||
PortableModeTrue = True
|
||||
Else
|
||||
PortableModeTrue = False
|
||||
End If
|
||||
|
||||
End Function 'PortableModeTrue
|
||||
|
||||
'Übergabe: ConfigFile [WorkDir] [AppName] Return: (PortableMode=True/False)
|
||||
'ConfigFile Nahme und Extendion - Wird Indirekt Geändert zu KonfigPfad
|
||||
'WorkDir Pfad des Arbeitsverzeichnises - Wird Indirekt Geändert
|
||||
'AppName Erstellt einen Neuern Ordner mit Diesen Nahme, wenn Nicht Portabler Mode
|
||||
|
||||
Public Function PortableMode(ByRef ConfigFile As String, Optional ByRef WorkDir As String = "-default-", Optional ByVal AppName As String = "-default-") As Boolean
|
||||
If AppName = ("-default-" Or "") Then
|
||||
AppName = Application.ProductName
|
||||
End If
|
||||
If Not Directory.Exists(WorkDir) Then WorkDir = "-default-"
|
||||
If WorkDir = ("-default-" Or "") Then
|
||||
WorkDir = Application.StartupPath
|
||||
End If
|
||||
|
||||
If File.Exists(Path.Combine(WorkDir, ConfigFile)) Then
|
||||
PortableMode = True
|
||||
ConfigFile = Path.Combine(WorkDir, ConfigFile)
|
||||
Else
|
||||
PortableMode = False
|
||||
WorkDir = Environment.GetEnvironmentVariable("APPDATA") & "\" & AppName
|
||||
If Not Directory.Exists(WorkDir) Then Directory.CreateDirectory(WorkDir)
|
||||
ConfigFile = Path.Combine(WorkDir, ConfigFile)
|
||||
If Not File.Exists(ConfigFile) Then File.Create(ConfigFile)
|
||||
End If
|
||||
|
||||
End Function 'PortableMode
|
||||
|
||||
'###################################################################################################################
|
||||
'############### 4.GPS_Tools #######################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
|
||||
Public Sub GPS_to_GMaps(ByVal GPS As String)
|
||||
'Soll anhand der GPS Koordinaten GoogleMaps öfnen
|
||||
'URL ansteuerung: https://developers.google.com/maps/documentation/staticmaps/
|
||||
' String = "52.520817 13.40945"
|
||||
'
|
||||
'Umrechnung von Geo-Koordinaten: http://rechneronline.de/geo-koordinaten/
|
||||
' ___________________________________________________________________________________________________
|
||||
'| Grad, Minuten, Sekunden | Dezimalgrad | Grad, Dezimalminuten |
|
||||
'| z.B. N52° 31' 14.941" E13° 24' 34.020" | z.B. 52.520817 13.40945 | z.B. N52° 31.249 E13° 24.567 |
|
||||
' ---------------------------------------------------------------------------------------------------
|
||||
' URL= "http://maps.google.com/maps?q=" & String
|
||||
'In Projekt SB-PictureTagger: Set a LincLable ;)
|
||||
End Sub
|
||||
'###################################################################################################################
|
||||
'############### 5.Ascii<->Base64 ##################################################################################
|
||||
'###################################################################################################################
|
||||
|
||||
'Ascii to Base64
|
||||
Public Function Ascii_To_Base64(ByVal AsciiString As String) As String
|
||||
Dim base64encoded As String = vbNull
|
||||
Dim raw As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(AsciiString)
|
||||
base64encoded = System.Convert.ToBase64String(raw)
|
||||
Ascii_To_Base64 = base64encoded
|
||||
End Function
|
||||
'Base64 to Ascii
|
||||
Public Function Base64_To_Ascii(ByVal Base64String As String) As String
|
||||
Try
|
||||
Dim raw As Byte() = System.Convert.FromBase64String(Base64String)
|
||||
Base64_To_Ascii = System.Text.ASCIIEncoding.ASCII.GetString(raw)
|
||||
Catch ex As Exception
|
||||
Base64_To_Ascii = ""
|
||||
End Try
|
||||
End Function
|
||||
End Module 'Modul_Tools
|
@ -72,11 +72,12 @@
|
||||
<Import Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form_SB-PictureTagger.vb">
|
||||
<Compile Include="Classen.vb" />
|
||||
<Compile Include="F_SB_PictureTagger.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form_SB-PictureTagger.Designer.vb">
|
||||
<DependentUpon>Form_SB-PictureTagger.vb</DependentUpon>
|
||||
<Compile Include="F_SB_PictureTagger.Designer.vb">
|
||||
<DependentUpon>F_SB_PictureTagger.vb</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
@ -94,13 +95,13 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Modul_SB-PictureTagger.vb" />
|
||||
<Compile Include="Modul_Tools.vb" />
|
||||
<Compile Include="TaggedIMG.vb" />
|
||||
<Compile Include="M_SB_PictureTagger.vb" />
|
||||
<Compile Include="M_Tools.vb" />
|
||||
<Compile Include="Setings.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Form_SB-PictureTagger.resx">
|
||||
<DependentUpon>Form_SB-PictureTagger.vb</DependentUpon>
|
||||
<EmbeddedResource Include="F_SB_PictureTagger.resx">
|
||||
<DependentUpon>F_SB_PictureTagger.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
|
14
SB-PictureTagger/Setings.vb
Normal file
14
SB-PictureTagger/Setings.vb
Normal file
@ -0,0 +1,14 @@
|
||||
Namespace Stammbaum.Settings
|
||||
Namespace PictureTagger
|
||||
Module PictureTagger
|
||||
Public Pub_oLoaded_TaggedIMG As New Stammbaum.Classen.PictureTagger.TaggedIMG
|
||||
Public Pub_sPath As String 'Pfad des Aktuell Arbeits Verzeichnises
|
||||
Public pub_aPfade(0) As String 'Array mit den Photo Pfaden
|
||||
Public pub_nPfadeIndex As Long = 0 'IndexNR des aktuell Geladenen Photos aus pub_aPfade
|
||||
Public pub_bChangeTagg As Boolean = False 'Wenn ein Tagg geänderd wird:= True bis SaveTagg()
|
||||
Public pub_aConfigForm(0) As String 'Array mit FormConfiguration
|
||||
Public pub_aSupportedFiles(0) As String 'Speichert die Unterstützten Extentions
|
||||
Public nOrdnerTiefe As Integer = 0 'Recursive Ordnertiefe beim Ordnereinlesen
|
||||
End Module
|
||||
End Namespace
|
||||
End Namespace
|
@ -1,63 +0,0 @@
|
||||
Public Class TaggedIMG2
|
||||
|
||||
'Soll die "Struktur" einmal ersetzen und zum Formweit ereichbares Objecte erstellen dienen
|
||||
|
||||
Public Class Mark
|
||||
Public PositionX As Long
|
||||
Public PositionY As Long
|
||||
Public ID As Long
|
||||
Public Radius As Long
|
||||
Public Description As String
|
||||
End Class 'Mark
|
||||
Public Class Place
|
||||
Dim Adresse
|
||||
Dim Description
|
||||
Dim GPS
|
||||
Public Sub Clear()
|
||||
Me.Adresse = Nothing
|
||||
Me.Description = Nothing
|
||||
Me.GPS = Nothing
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public ID As String
|
||||
Public Title As String
|
||||
Public Description As String
|
||||
Public Time As String
|
||||
Public Markierung() As Mark
|
||||
Public Image As Image
|
||||
Public Path As String
|
||||
Public Ort As Place
|
||||
|
||||
Public Sub Clear()
|
||||
Me.ID = Nothing
|
||||
Me.Image = Nothing
|
||||
Me.Title = Nothing
|
||||
Me.Description = Nothing
|
||||
Me.Time = Nothing
|
||||
Me.Path = Nothing
|
||||
Me.Ort.Clear()
|
||||
ReDim Me.Markierung(0)
|
||||
Me.Markierung(0).Description = Nothing
|
||||
Me.Markierung(0).PositionX = Nothing
|
||||
Me.Markierung(0).PositionY = Nothing
|
||||
Me.Markierung(0).ID = Nothing
|
||||
Me.Markierung(0).Radius = Nothing
|
||||
End Sub
|
||||
|
||||
Public Sub Create_NewMark(ByVal ID As Long, ByVal PositionX As Long, ByVal PositionY As Long, Optional ByVal Radius As Long = 10, Optional ByVal Description As String = "")
|
||||
Dim Index As Integer
|
||||
'If Me.Mark(0) is not Initalisiert Then
|
||||
' Index = 0
|
||||
'Else
|
||||
Index = 1 + UBound(Me.Markierung)
|
||||
'End if
|
||||
ReDim Me.Markierung(Index)
|
||||
Me.Markierung(Index).ID = ID
|
||||
Me.Markierung(Index).PositionX = PositionX
|
||||
Me.Markierung(Index).PositionY = PositionY
|
||||
Me.Markierung(Index).Radius = Radius
|
||||
Me.Markierung(Index).Description = Description
|
||||
End Sub
|
||||
|
||||
End Class
|
Loading…
Reference in New Issue
Block a user