Message 1 of 2
Extracting thumbnail vb.net

Not applicable
10-13-2015
01:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I found the following code to extract a thumbnail image from an inventor part.. However I get an error saying
Error 1 'Compatibility' is not declared. It may be inaccessible due to its protection level.
how do I fix this?
The code:
' Create an instance of Apprentice. Dim apprentice As New ApprenticeServerComponent ' Open a document. Dim doc As ApprenticeServerDocument doc = apprentice.Open("C:\test.ipt") ' Get the Summary Information property set. Dim summaryInfo As PropertySet summaryInfo = doc.PropertySets.Item( _ "Inventor Summary Information") ' Get the thumbnail property. Dim thumbProp As Inventor.Property thumbProp = summaryInfo.Item("Thumbnail") ' Get the thumbnail image. Dim thumbnail As stdole.IPictureDisp thumbnail = thumbProp.Value ' Convert the IPictureDisp object to an Image. Dim img As Image = Compatibility.VB6.IPictureDispToImage(thumbnail) ' Display the image in the picture box. PictureBox1.Image = img
The orriginal code was found at the following url...
http://modthemachine.typepad.com/my_weblog/2010/06/accessing-thumbnail-images.html