
Originally Posted by
fafalone
......
And also see the
SetPreviewPictureWithHBITMAP function that's setting it in my code?
Code:
picturebox.Cls
hBitmapToPictureBox picturebox, hBmp
picturebox.Refresh
(Don't forget the DeleteObject call when you're done with the hbitmap as well.)
......
I am using the code that you provided in post #16.
Thanks for your help.
Let me see if I have understood this right or not.
Here is how I use DeleteObject:
Code:
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Code:
Public Sub SetPreviewPictureWithHBITMAP(picturebox As Object, hBmp As Long, Optional bDestroy As Boolean = False)
picturebox.Cls
hBitmapToPictureBox picturebox, hBmp
picturebox.Refresh
If bDestroy Then
DeleteObject hBmp
End If
End Sub
Code:
Thumbnail_P_B.Cls
hBitmap = GetFileThumbnail(Video_File_Path, 0, Thumbnail_P_B.ScaleWidth, Thumbnail_P_B.ScaleHeight)
Call hBitmapToPictureBox(Thumbnail_P_B, hBitmap)
Thumbnail_P_B.Refresh
DeleteObject hBitmap
Is that all you mean?
Or should I call it elsewhere as well?
Also, somebody suggested that I can cache the thumbnails, and re-use them, and that at the end when I no longer need to re-use them, I need to delete those cached thumbnails.
I don't know how to do that.
A. How can I cache thumbnails for later re-use?
B. How do I re-use cached thumbnails?
C. How do I delete cached thumbnails in the end?
Please advise.
Thanks.
Ilia