i want to change the backgroun color to a solid white before i save an image of an .iam to file.
so far:
Inventor.Color bgColor = InvApp.TransientObjects.CreateColor(255, 255, 255);
Camera.SaveAsBitmap("C:\\Users\\Dan\\Desktop\\test.jpg", 800, 800, bgColor);
This does nothing to the image, same gradient BG set from the colorschemes.
i tried:
InvApp.ColorSchemes.BackgroundType = BackgroundTypeEnum.kOneColorBackgroundType;
just for giggles and it does in fact change the BG to a solid grey. But after that, i see no way to change the BG.
InvApp.ColorSchemes.Item("Presentation").Activate;
does not work either as the .Item sub class does not even under the colorschemes object.
im sure i am passing the wrong color object to the saveasbitmap method anyway - i just need someone to tell me the right object.....but this forum is a desert for anything not 2013....
cheers
Sounds like correct, here's a sample for your reference, note that it's passing 2 colors
Sub test()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oView As View
Set oView = oDoc.Views(1)
'Get the camera from the active view
Set oCamera = oView.Camera
oCamera.Fit
oCamera.Apply
Dim oTO As TransientObjects
Set oTO = ThisApplication.TransientObjects
Dim oTop As Color
Set oTop = oTO.CreateColor(255, 0, 0)
Dim oBottom As Color
Set oBottom = oTO.CreateColor(255, 255, 255)
oCamera.SaveAsBitmap "C:\ViewCamera.jpg", 800, 600, oTop, oBottom
End Sub
Just use this code and it will work fine for your needs.
Sub test()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oView As View
Set oView = oDoc.Views(1)
'Get the camera from the active view
Set oCamera = oView.Camera
oCamera.Fit
oCamera.Apply
Dim oTO As TransientObjects
Set oTO = ThisApplication.TransientObjects
Dim oTop As Color
Set oTop = oTO.CreateColor(255, 0, 0)
Dim oBottom As Color
Set oBottom = oTO.CreateColor(255, 255, 255)
oCamera.SaveAsBitmap "C:\ViewCamera.jpg", 800, 600, oTop, oBottom
End Sub