Advertisement
| Hall of Fame |
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: |
Imports System
Imports System.IO
Public Class ImageBrowser
Private thumbWidth As Byte = 150
Private thumbHeight As Byte = 150
Private Sub ImageBrowser_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
End
End Sub
Private Sub ImageBrowser_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ProgressHolder.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
RepositoryItemProgressBar1.ProgressViewStyle = DevExpress.XtraEditors.Controls.ProgressViewStyle.Broken
RepositoryItemProgressBar1.PercentView = True
End Sub
Private Sub updateImages(ByVal Folder() As String)
Dim fi As FileInfo
Dim fileName As String
Dim thumbEntry As ListViewItem
Dim imageList1 As ImageList = New ImageList
Dim p As Integer, i As Integer, numFiles As Integer = Folder.Length
Dim myCallback As Image.GetThumbnailImageAbort = New Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)
pnlView.Items.Clear()
imageList1.ColorDepth = ColorDepth.Depth24Bit
imageList1.ImageSize = New Size(thumbWidth, thumbHeight)
pnlView.LargeImageList = imageList1
pnlView.SmallImageList = imageList1
pnlView.BeginUpdate()
RepositoryItemProgressBar1.Step = 0
ProgressHolder.Visibility = True
i = 0
Dim dtA As New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, Now.Minute, Now.Second)
Debug.WriteLine(dtA.ToString)
For Each fileName In Folder
fi = New FileInfo(fileName)
If fi.Extension.ToUpper.Equals(".BMP") Or fi.Extension.ToUpper.Equals(".JPG") Or _
fi.Extension.ToUpper.Equals(".PNG") Or fi.Extension.ToUpper.Equals(".GIF") Then
Try
imageList1.Images.Add(GetResizedImage(Image.FromFile(fi.FullName), thumbWidth, thumbHeight))
thumbEntry = New ListViewItem
thumbEntry.Text = fi.Name
thumbEntry.ImageIndex = imageList1.Images.Count - 1
pnlView.Items.Add(thumbEntry)
Catch ex As Exception
MsgBox(fi.FullName & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Information, "Error Loading Image")
End Try
End If
i = i + 1
Files.Caption = "Images: " & i
p = CInt(i / numFiles * 100)
RepositoryItemProgressBar1.Step = p
Application.DoEvents()
Next fileName
Dim dtB As New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, Now.Minute, Now.Second)
Debug.WriteLine(dtB.ToString)
ProgressHolder.Visibility = False
pnlView.EndUpdate()
Dim ts As TimeSpan = dtB.Subtract(dtA)
Debug.WriteLine(ts.ToString)
Debug.WriteLine(ts.TotalMinutes)
End Sub
Private Function ThumbnailCallback() As Boolean
Return False
End Function
Private Sub BarButtonItem2_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
updateImages(Directory.GetFiles("C:\Users\Jnr\Documents\Azureus Downloads\IS Lumina General Icons\256\256"))
End Sub
End Class
|