Article Number: 7542
Subject: Re: How can I use SEThumbnails.dll in Vb.NET to extract a Preview Bitmap
From: "Herbert Goletz" <goletz.herbert@krones.de>
Date: 29 Jan 2008 23:07:14 -0800
Newsgroups: solid_edge.programming
Hi Günther
GetThumbnail returns a handle (pointer) to a bitmap.
The following sample loads the preview image of a file to
the referenced PictureBox control:
Private Sub ShowPreviewImage(ByVal pictureBoxPreview as PictureBox, ByVal fullPath
As String)
Dim thumbnailExtractor As New SeThumbnailLib.SeThumbnailExtractor
Dim hBitmap As IntPtr
thumbnailExtractor.GetThumbnail(fullPath, hBitmap)
If (hBitmap <> IntPtr.Zero) Then
pictureBoxPreview.SizeMode = PictureBoxSizeMode.Zoom
pictureBoxPreview.WaitOnLoad = True
pictureBoxPreview.Image = Image.FromHbitmap(hBitmap)
End If
If (thumbnailExtractor IsNot Nothing) Then
Marshal.ReleaseComObject(thumbnailExtractor)
End If
End Sub
Herbert
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP