Bug in new SetItemBitmap() routine?

Discussions about document viewing.
Post Reply
jriddell
Posts: 5
Joined: Thu May 19, 2011 2:09 am

Bug in new SetItemBitmap() routine?

Post by jriddell » Mon Jul 11, 2011 8:36 pm

I have recently upgraded to V8 (yea!).

I noticed that you were true to your word and added the ThumbnailMgr.SetItemBitmap() routine
as I requested in the "How to update an already displayed Thumbnail?" thread.

Great, thanks !!

So, I already had an ugly (but working) work around (as you had suggested) but I was eager to change to using this API.

My testing seems to show that the routine does not work as advertized.

The issue is with the passed in index. It APPEARS that:
- the index is validated to be in the 0 .. ThumbCount-1 range
- however, a request to set the bitmap at index = N affects the bitmap at index = N + 1
(as long as N+1 is in the range of 0 to ThumbCount-1)

This means that even if I pass in Index+1 (as a hack), I can get all bitmaps properly updated EXCEPT for the last one,
because the validation range check seems to occur BEFORE the bitmaps are updated.

Can you please confirm this?

thanks

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

Re: Bug in new SetItemBitmap() routine?

Post by Loïc » Tue Jul 12, 2011 12:01 pm

Hi,

I am not able to reproduce the problem.
Here what I tried:

- Step1: load itemsfrom a directory

Code: Select all

ThumbnailEx1.LoadFromDirectory("D:\folder", True)
- Step2, the the loading is done, apply a dummy image on all items:

Code: Select all

      Dim bm As Image
      bm = Bitmap.FromFile("c:\dummy.bmp")
      ThumbnailEx1.SetItemBitmap(0, CType(bm, Bitmap))

      For i As Integer = 0 To ThumbnailEx1.ItemCount - 1
         ThumbnailEx1.SetItemBitmap(i, CType(bm, Bitmap))
      Next

let me know if the problem persists.

Loïc


Note: Tested with 8.0.3

jriddell
Posts: 5
Joined: Thu May 19, 2011 2:09 am

Re: Bug in new SetItemBitmap() routine?

Post by jriddell » Wed Jul 13, 2011 12:16 am

I appreciate the effort (and I'm trying not to whine) but that's not the API that I'm talking about.

You tested:

Code: Select all

Public Sub SetItemBitmap(
    ByVal ItemIdx As Integer, 
    ByVal Image As Bitmap
)
and I am using:

Code: Select all

Public Sub SetItemBitmap(
    ByVal ItemIdx As Integer, 
    ByVal ImageID As Integer
)
Thank you.

jriddell
Posts: 5
Joined: Thu May 19, 2011 2:09 am

Re: Bug in new SetItemBitmap() routine?

Post by jriddell » Wed Jul 13, 2011 12:25 am

And, reading back, I can see that I DID NOT specify which one I was using.

So, bad on me for making a non-specific request.

And, to be clear, I appreciate all your efforts.

Thanks.

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

Re: Bug in new SetItemBitmap() routine?

Post by Loïc » Wed Jul 13, 2011 10:23 am

Hi,

No problem :D

Here what I tried:

Code: Select all

     Dim bm As Integer
      bm = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.jpg")


      For i As Integer = 0 To ThumbnailEx1.ItemCount - 1
         ThumbnailEx1.SetItemBitmap(i, bm)
      Next
This works like a charm.

Does the problem persists on your side ?

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest