corientdev / imagelistview

Automatically exported from code.google.com/p/imagelistview
1 stars 0 forks source link

Freeze #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Respected Sir,
      i am loading PSD files always in ImageListView Control now i faced new problem.

this is my ImageListView SelectionChanged event codes
 Private Sub LSI_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LSI.SelectionChanged
            Try
                lblSelItemsCount.Text = LSI.SelectedItems.Count
                For Each _itmS As Manina.Windows.Forms.ImageListViewItem In LSI.SelectedItems
                     lblFileName.Text = _itmS.Text
                     lblFileSize.Text = _itmS.FileSize
                Next
            Catch ex As Exception
                  MessageBox.Show(ex.ToString)
            End Try
   End Sub

  now i am loading psd files, IMGLSV taking more time to create thumbnails in this time when i clicked on any one item, Application freezed some minutes then again create thumbnails.

 but after i removed SelectionChanged event codes then loading files, not freeze it's working as normal when i am clicking any items, nothing happen working as charm.

 so is that possible to findout:

1) HOW TO KNOW IF CONTROL CREATED ALL THUMBNAILS SUCCESSFULLY
2) ELSE HOW TO KNOW CONTROL CREATED THUMBNAILS IN VIEW-ABLE[CONTROL SIZE IN 
FORM] AREA
3) PAUSE OPTION IS POSSIBLE TO CREATING THUMBNAILS
4) HAVE ANY EVENT IS RAISE WHILE CREATING THUMBNAILS

  I was test a folder [contain 100 psd files 36inchx12inch as per size 125MB approx] in Win7 Explorer
it's taking time but i click on any item while thumbs creating process not 
Freeze.

Thanks,
Raj

Original issue reported on code.google.com by medhelpn...@gmail.com on 5 Aug 2011 at 8:49

GoogleCodeExporter commented 9 years ago
 I was test a folder [contain 100 psd files 36inchx12inch as per size 125MB approx] in Win7 Explorer
it's taking time but i click on any item while thumbs creating process not 
Freeze but shows in status bar
how many items are selected.

Original comment by medhelpn...@gmail.com on 5 Aug 2011 at 8:51

GoogleCodeExporter commented 9 years ago
The culprit is the lblFileSize.Text = _itmS.FileSize line above. File sizes are 
read async by the control; but when you explicitly require the file size, it 
synchronously reads the file sizes, halting the UI thread. 

Unfortunately, there is no workaround for that. The control could return an 
empty string if the file size is not yet read by the worker thread, but I'm not 
sure if this is the right thing to do.

Original comment by oozcitak on 8 Aug 2011 at 10:19

GoogleCodeExporter commented 9 years ago
For the rest of your question... You can handle the ThumbnailCached and 
ThumbnailCaching events. 

And the control pauses the worker threads while it is disabled.

Original comment by oozcitak on 8 Aug 2011 at 10:32

GoogleCodeExporter commented 9 years ago
Thank You So Much Sir.i removed this line[lblFileSize.Text = _itmS.FileSize]now 
working fine.but is't possible to check, the selected ImageListViewItem is 
thumbnail created or not?.

Original comment by medhelpn...@gmail.com on 13 Aug 2011 at 9:57

GoogleCodeExporter commented 9 years ago
You can check the CacheState property of the item.

Original comment by oozcitak on 13 Aug 2011 at 9:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Dear Sir;
         can you test this step if u r free...

 below code is my IMGLSV controls dropping files event because i want to adding image type files from explorer.

Code: ==========================
 'LSI
        Private Sub LSI_DropFiles(ByVal sender As Object, ByVal e As Manina.Windows.Forms.DropFileEventArgs) Handles LSI.DropFiles
            Try
                Dim _ext$ = Nothing
                For d% = 0 To e.FileNames.Count - 1
                    If e.FileNames(d).ToString = Nothing Then e.Cancel = True
                    If My.Computer.FileSystem.FileExists(e.FileNames(d).ToString) = False Then e.Cancel = True

                    _ext = IO.Path.GetExtension(e.FileNames(d).ToString.ToLower)
                    Select Case _ext
                        Case Is = ".jpg", ".psd", ".bmp", ".png", ".tif", ".tga"
                        Case Else
                            e.Cancel = True
                    End Select
                Next
                LSI.Update()
                LSI.Refresh()
            Catch ex As Exception
                My.VeniceHelpingClass.DisplayStatus(ex.ToString, "Error: DroppingFiles", MessageBoxButtons.OK, MessageBoxIcon.Error, True)
            End Try
        End Sub
===========================

Original comment by medhelpn...@gmail.com on 20 Aug 2011 at 5:54

GoogleCodeExporter commented 9 years ago
but my problem is........

            i can adding[drag n drop] files from explorer into IMGLSV which is very fine, but
i unfortunately dropped MYCOMPUTER icon from desktop i got something weird.

My control Properties:
**********************
 LSI.AllowDrop = True
 LSI.AllowDrag = True
 LSI.MultiSelect = True
 LSI.View = View.Thumbnails 

   please add some image files into control then dragged MYCOMPUTER icon into control
you can see the [MouseCursor]blocked cursor, but into control u can see the 
Inserted LINE[it's the problem] in between the
two items if i removed the mouse click this line is not update or not hide it's 
still persist.
but i was already added LSI.Update() and LSI.Refresh() method in 
'LSI_DropFiles' event but that line is not hide.

i think if mouse cursor is Blocked Cursor then don't allowed Inserted Item.

sorry for the poor english i think you can understand what i mean

Thank Your Sir....
Raj...............

Original comment by medhelpn...@gmail.com on 20 Aug 2011 at 6:07

GoogleCodeExporter commented 9 years ago
sorry for this i don't know this is the Issue or not ..please excuse me........

Original comment by medhelpn...@gmail.com on 20 Aug 2011 at 6:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r657.

Original comment by oozcitak on 24 Aug 2011 at 1:28

GoogleCodeExporter commented 9 years ago
Thank you for fixed.

Original comment by medhelpn...@gmail.com on 27 Aug 2011 at 5:51