.RedrawItem Method

Discussions about the ThumbnailEx control of GdPicture.NET.
Post Reply
andrew
Posts: 18
Joined: Tue Jul 24, 2007 9:30 pm

.RedrawItem Method

Post by andrew » Wed Oct 24, 2012 7:05 pm

I seem to be having an issue with the ThumbnailEx control, particularly the ThumbnailEx.RedrawItem method.
I am not sure if I am missing something, but whenever I call ThumbnailEx1.RedrawItem(Idx) the thumbnail does not actually update.

Code: Select all

    Private Sub ThumbnailEx1_ItemDoubleClicked(ByVal Idx As Integer) Handles ThumbnailEx1.ItemDoubleClicked
        Dim edt As New Editor
        edt.FileName = ThumbnailEx1.GetItemFileSource(Idx)
        If edt.ShowDialog() = Windows.Forms.DialogResult.OK Then
            ThumbnailEx1.RedrawItem(Idx)
        End If
    End Sub
Calling .ReloadThumbnails causes the correct image to be displayed, but there are some obvious issues with using that as a work around.

Any suggestions would be greatly appreciated.

Andrew

(Edit: I am currently running 9.2.0.1)

andrew
Posts: 18
Joined: Tue Jul 24, 2007 9:30 pm

Re: .RedrawItem Method

Post by andrew » Wed Oct 24, 2012 7:33 pm

Quick update,
Setting the .PreloadAllItems to false allowed the thumbnail to update, but only once another thumbnail was selected.
Calling .SelectItem(Idx) to re-select the current thumbnail works and refreshes the image as desired.

This seems to work well enough, but I'll leave the question out there as I don't think this was how it was intended to function.

Code: Select all

    Private Sub ThumbnailEx1_ItemDoubleClicked(ByVal Idx As Integer) Handles ThumbnailEx1.ItemDoubleClicked
        Dim edt As New Editor
        edt.FileName = ThumbnailEx1.GetItemFileSource(Idx)
        ' edt.ImageIDX = Idx
        If edt.ShowDialog() = Windows.Forms.DialogResult.OK Then
            ThumbnailEx1.RedrawItem(Idx)
            ThumbnailEx1.SelectItem(Idx)
        End If
    End Sub

andrew
Posts: 18
Joined: Tue Jul 24, 2007 9:30 pm

Now I am very confused

Post by andrew » Wed Oct 24, 2012 8:11 pm

It seems that the problem just appeared to be fixed by setting PreloadAllItems = false. The true issue is that RedrawItem only works until all the thumbnails are loaded, by setting PreloadAllItems = false we stopped loading all the thumbnails until required (assuming there are more thumbnails that fit in the control)
At this point the RedrawItem method works fine (though you do need to still call the SelectItem, or seleted another thumbnail) once all the thumbanils are loaded the RedrawItem method no longer functions.

Andrew

User avatar
Loïc
Site Admin
Posts: 5584
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: .RedrawItem Method

Post by Loïc » Thu Oct 25, 2012 12:48 pm

Hello Andrew,

Unfortunately it is totally impossible for me to understand the issue since I need to know the Thumbnail loading context.
So it should be great if you could reproduce the issue in a standalone application that you can share with the dev team through http://support.gdpicture.com, so we will be able to quickly provide a solution.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest