SetThumbnailSaveOption bad image resoluation

SetThumbnailSaveOption bad image resoluation

psaarloos
Collaborator Collaborator
156 Views
1 Reply
Message 1 of 2

SetThumbnailSaveOption bad image resoluation

psaarloos
Collaborator
Collaborator

Hi,

 

I am using the code below to specify my own custom image for an Inventor document, but somehow the resolution is always bad (rough edges), even if the source image I am specifying looks fine in Windows Explorer. What's the best format and size to create an image to import as thumbnail? Is there a better way to modify the thumbnail for a document?

 

Thanks in advance for your help!

 

myDocument.SetThumbnailSaveOption(ThumbnailSaveOptionEnum.kImportFromFile, thumbnailFilePath)

 

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
157 Views
1 Reply
Reply (1)
Message 2 of 2

JelteDeJong
Mentor
Mentor

I don't know what the official size should be but I used the following iLogic rule to test some sizes. The best result I got with a size 256x256.

Dim size As Integer = 256
Dim fileName As String = "c:\temp\tumber.bmp"

Dim cam As Camera = ThisApplication.ActiveView.Camera
cam.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopLeftViewOrientation
cam.Fit()
cam.ApplyWithoutTransition()
cam.SaveAsBitmap(fileName, size, size)

Dim doc As PartDocument = ThisDoc.Document
doc.SetThumbnailSaveOption(ThumbnailSaveOptionEnum.kImportFromFile, fileName)
doc.Save()

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes