Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Camera.SaveAsBitmap Method

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
680 Views, 3 Replies

Camera.SaveAsBitmap Method

 

Hi,

 

I'm currently writing a C# application using the InventorApprentice library and I had a question with regards to the parameters of the SaveAsBitmap method.

 

The parameter list is (filename, width, height, topColor, bottomColor).

 

The two colors are defined as objects, but I've yet to figure out how to get them to pass successfully. I'm assuming they are used to overwrite the background/foreground colors. I would like to be able to force the background (bottomColor) to White if possible.

 

Does anyone have any suggestions?

 

Thanks,

Jon

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

 

Does  anyone know where I can get documentation on the Camera.SaveAsBitmap method? The generic type of "Object" for the top and bottom color is not giving me much to go on.

 

I'm able to pass null successfully, but I would actually like to specify the color objects if possible.

 

Thanks,

- Jon

 

 

Message 3 of 4
Anonymous
in reply to: Anonymous

I have YET to have a SINGLE question answered on this forum. Yet another example of a simple question being completley ignored... WHAT IS THE OBJECT TYPE AND ENUM FOR PASSING COLOR IN THE SaveAsBitmap parameters?

 

so far:

 

Inventor.Color bgColor = InvApp.TransientObjects.CreateColor(255, 255, 255);

 

this does nothing when passed into the method.

 

Then again - i might as well be talking to a wall on this forum anyway....

 

FYI - in documentation - ByRef topColor As [optional] VARIANT, ByRef bottomColor As [optional] VARIANT means abosultye zero with no table for variant descriptions....

Message 4 of 4
Vladimir.Ananyev
in reply to: Anonymous

The TopColor and BottomColor arguments take a Color object.  

Public Sub CreateImageTest()
    Dim v As View
    Set v = ThisApplication.ActiveView
    
    Dim cam As Camera
    Set cam = v.Camera

    'Red color
    Dim top As Color
    Set top = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
    'Green color
    Dim bottom As Color
    Set bottom = ThisApplication.TransientObjects.CreateColor(0, 255, 0)
    
    'gradient background (red to green)
    Call cam.SaveAsBitmap("C:\Temp\Test.png", _
                v.Width, v.Height, top, bottom)
End Sub

Test.png 

Hope this helps.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report