Page 1 of 1

How to extract thumbnail image from files?

Posted: Tue Dec 05, 2006 3:21 am
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

Re: How to extract thumbnail image from files?

Posted: Tue Dec 12, 2006 1:33 pm
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

Posted: Thu Dec 14, 2006 3:08 am
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

Posted: Thu Dec 14, 2006 3:16 am
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