Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Ionic.Zip
- Public Class Main
- Dim PhotoshopApp As Photoshop.Application
- Dim photoshopDoc As Photoshop.Document
- Dim curLayer As Photoshop.ArtLayer
- Dim psstring As String
- Dim appPath As String = Application.StartupPath()
- Private Sub Browse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Browse.Click
- Dim dlg As New FolderBrowserDialog
- If dlg.ShowDialog = DialogResult.OK Then
- ThumbnailGenerate1.Directorypath = dlg.SelectedPath
- TextBox1.Text = dlg.SelectedPath
- End If
- End Sub
- Private Sub Lock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Lock.Click
- If TextBox1.Text <> "" Then
- If ThumbnailGenerate1.Controls.OfType(Of CheckBox)().Any(Function(cb) cb.Checked) Then
- For Each cb1 As CheckBox In ThumbnailGenerate1.Controls.OfType(Of CheckBox)()
- If cb1.Checked Then
- My.Computer.FileSystem.CopyFile(TextBox1.Text & "\" & cb1.Text, appPath & "\tmp\" & cb1.Text, True)
- End If
- Next
- IO.File.SetAttributes(appPath & "\tmp", IO.FileAttributes.Hidden)
- LockFrm.ShowDialog()
- Else
- MsgBox("No files selected!")
- End If
- Else
- MsgBox("Please Select a folder first!")
- End If
- End Sub
- Private Sub ThumbnailGenerate1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
- End Sub
- Private Sub ThumbnailGenerate2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
- End Sub
- Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If IO.Directory.Exists(appPath & "\tmp\") Then
- System.IO.Directory.Delete(appPath & "\tmp\", True)
- End If
- SplashScreen.BarLong(100)
- Dim i As Integer = 0
- While i <= 100
- SplashScreen.ShowBar(i)
- i += 1
- Threading.Thread.Sleep(100)
- End While
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- If TextBox1.Text <> "" Then
- PhotoshopApp = New Photoshop.ApplicationClass
- PhotoshopApp.DisplayDialogs = Photoshop.PsDialogModes.psDisplayNoDialogs
- PhotoshopApp.PlaybackDisplayDialogs = Photoshop.PsDialogModes.psDisplayNoDialogs
- If TabControl1.SelectedTab Is Raw Then
- For Each cb1 As CheckBox In ThumbnailGenerate1.Controls.OfType(Of CheckBox)()
- If cb1.Checked Then
- psstring = TextBox1.Text & "\" & cb1.Text
- photoshopDoc = PhotoshopApp.Open(psstring)
- End If
- Next
- ElseIf TabControl1.SelectedTab Is Selection Then
- For Each cb2 As CheckBox In ThumbnailGenerate2.Controls.OfType(Of CheckBox)()
- If cb2.Checked Then
- psstring = TextBox1.Text & "\" & cb2.Text
- photoshopDoc = PhotoshopApp.Open(psstring)
- End If
- Next
- End If
- Else
- MsgBox("Please Select a folder first!")
- End If
- End Sub
- Public Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- If TextBox1.Text <> "" Then
- OpenFileDialog1.Filter = "JWS Files (*.jws*)|*.jws"
- If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
- Then
- Dim lines() As String = IO.File.ReadAllLines(OpenFileDialog1.FileName)
- For Each line As String In lines
- My.Computer.FileSystem.CopyFile("" & TextBox1.Text & "\" & line, "" & TextBox1.Text & "\selection\" & line, True)
- Next
- MsgBox("All File Successfully Copied to selection folder inside your image directory!")
- ThumbnailGenerate2.Directorypath = TextBox1.Text & "\selection\"
- TabControl1.SelectTab(Selection)
- End If
- Else
- MsgBox("Please Select a folder first!")
- End If
- End Sub
- Public Delegate Sub SetProgressBarDelegate(ByVal max As Integer)
- Public Delegate Sub UpdateProgressBarDelegate(ByVal value As Integer)
- Public Sub BarLong(ByVal MemCount As Integer)
- If Me.InvokeRequired Then
- Me.Invoke(New SetProgressBarDelegate(AddressOf BarLong), MemCount)
- Else
- Me.ProgressBar1.Maximum = MemCount
- End If
- End Sub
- Public Sub ShowBar(ByVal SoFar As Integer)
- If Me.InvokeRequired Then
- Me.Invoke(New UpdateProgressBarDelegate(AddressOf ShowBar), SoFar)
- Else
- Me.ProgressBar1.Value = SoFar
- End If
- End Sub
- End Class
Add Comment
Please, Sign In to add comment