Vault Customization

Reply
Active Contributor
wannensn
Posts: 38
Registered: ‎05-17-2005
Message 1 of 3 (217 Views)
Accepted Solution

Thumbnail Property

217 Views, 2 Replies
04-30-2012 03:53 AM

Hi,

 

I'm using the example from the API help to create a image from the thumbnail property data. But I always get a GDI+ exception when creating the Metafile from the stream.

 

Dim thumbnailRaw As Byte() = CType(propInst.Val, Byte())
Dim stream As System.IO.Stream = New System.IO.MemoryStream(thumbnailRaw, 12, thumbnailRaw.Length - 12)

Dim metafile As System.Drawing.Imaging.Metafile = New System.Drawing.Imaging.Metafile(stream)
Dim retVal As Image = metafile.GetThumbnailImage(width, height, New Image.GetThumbnailImageAbort(AddressOf GetThumbnailImageAbort), IntPtr.Zero)
 tream.Close()

 

Regards, Stephan

Hello Stephan,

 

It looks like the code you're using if from Doug's older post about reading thumbnails. If you're using this code on Vault 2012 and newer, it has the possibility of throwing the GDI+ exception if the image format of the thumbnail is not a metafile. This can happen because new image formats were added for thumbnails in Vault 2012. Please see this post on Doug's blog: http://justonesandzeros.typepad.com/blog/2011/05/viewing-thumbnails.html. Please try the code sample there and let me know if that works.

Employee
Daniel.Dulzo
Posts: 61
Registered: ‎05-25-2011
Message 2 of 3 (213 Views)

Re: Thumbnail Property

04-30-2012 07:54 AM in reply to: wannensn

Hello Stephan,

 

It looks like the code you're using if from Doug's older post about reading thumbnails. If you're using this code on Vault 2012 and newer, it has the possibility of throwing the GDI+ exception if the image format of the thumbnail is not a metafile. This can happen because new image formats were added for thumbnails in Vault 2012. Please see this post on Doug's blog: http://justonesandzeros.typepad.com/blog/2011/05/viewing-thumbnails.html. Please try the code sample there and let me know if that works.



Daniel Dulzo
Software Engineer
Autodesk, Inc.
Active Contributor
wannensn
Posts: 38
Registered: ‎05-17-2005
Message 3 of 3 (202 Views)

Re: Thumbnail Property

05-01-2012 11:59 PM in reply to: Daniel.Dulzo

Hi Daniel,

 

thanks, now it works.

 

I used the code from the API help (Vault 2013)! Please review the docs, it is the second time in the last weeks that I found incorrect information in the Knowledge Base Articles:

 

-Viewing Thumbnail Properties

-Uploading and Downloading (XML is for server side configuration not client side)

 

Regards, Stephan 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.