How to extract thumbnail image from files?

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
chomk
Posts: 3
Joined: Wed Oct 18, 2006 8:04 am

How to extract thumbnail image from files?

Post by chomk »

Hello,

What is the difference between ExportToClipboard and SendBinary?

In Windows XP pro, I have to use .ExportToClipboard() method of GFLAX and then use clipboard image to show in VB.net Picture box control. In Win 2000, I can use .SendBinary() method. I cannot use SendBinary method in XP.

Please correct me if my code is wrong. I use VB.Net with VStudio 2005. My code works, but I don't it's a correct way to extract thumbnail from files. I can display images and PDF files with these code.

Dim objGFL as New GflAx.GflAx

With objGFL
.LoadBitmap(strFileName)
.SaveFormat = AX_JPEG
IF WinXP Then
.ExportToClipboard()
Else
Dim objMS as MemoryStream = New MemoryStream( .SendBinary() )
End If
End With

And then I can use clipboard or memory stream to display image in Picture box control. I don't want to use two methods according to OS. Is there any other way to extract image from files (images or PDF)?

Thanks in advance
CMK
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to extract thumbnail image from files?

Post by xnview »

chomk wrote:Hello,

What is the difference between ExportToClipboard and SendBinary?

In Windows XP pro, I have to use .ExportToClipboard() method of GFLAX and then use clipboard image to show in VB.net Picture box control. In Win 2000, I can use .SendBinary() method. I cannot use SendBinary method in XP.
ExportToClipboard is to export picture in widnows clipboard. SendBinary send picture on the stream
Pierre.
chomk
Posts: 3
Joined: Wed Oct 18, 2006 8:04 am

Post by chomk »

Thanks for your reply. I know it already. But I cannot use SendBinary function on my Windows XP (Pro - service pack 2). It causes exception - "Specified array was not of the expected type.". This function works well on Windows 2000 machine and I can load thumbnail image from returned stream.

Regards
chomk
Posts: 3
Joined: Wed Oct 18, 2006 8:04 am

Post by chomk »

Sorry, I need to add some more details.

That exception occurs when calling SendBinary function with TIF image. But I'm sure the same result with other supported file formats (eg. PDF).

Thanks
Post Reply