SaveAsBitmap method doesn't honor topColor and bottomColor arguments

SaveAsBitmap method doesn't honor topColor and bottomColor arguments

psaarloos
Collaborator Collaborator
440 Views
1 Reply
Message 1 of 2

SaveAsBitmap method doesn't honor topColor and bottomColor arguments

psaarloos
Collaborator
Collaborator

Hi,

 

The SaveAsBitmap method doesn't seem to honor the optional topColor and bottomColor arguments anymore when the Inventor background is set to 'Background Image' instead of '1 Color' or 'Gradient'. This behavior seems to have been changed since Inventor 2016. It was working correctly in Inventor 2015 and before.

 

Can this be reproduced and fixed? I am using this code to create a thumbnail with a white background.

 

Dim transientObjects As TransientObjects = _inventorApplication.TransientObjects
Dim backGroundColor As Color = transientObjects.CreateColor(255, 255, 255)

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

sajith_subramanian
Autodesk Support
Autodesk Support

 

Hi psaarloos,

 

I am able to reproduce the issue as well.

 

As a workaround can you try the following piece of code. It seems to work on Inventor 2017.

 

Sub main()
Dim transientObjects As transientObjects
Set transientObjects = ThisApplication.transientObjects

Dim backGroundColor As Color
Set backGroundColor = transientObjects.CreateColor(255, 255, 255)

Dim cam As Camera
Set cam = ThisApplication.ActiveView.Camera
    
Dim oImage As IPictureDisp
Set oImage = ThisApplication.ActiveView.Camera.CreateImage(600, 600, backGroundColor)
stdole.SavePicture oImage, "C:\TEMP\image1.jpg"

End Sub

 

Please let me know if it helps.

 

Regards,

Sajith


Sajith Subramanian
Autodesk Developer Network
0 Likes