Change Backgroundcolor for RenderToDC

Hi

i want to create a preview image of some selected objects. For this i use RhinoApp().ActiveDoc()->RenderToDC which works perfect for my situation.
Now i want to set the background color of the preview image (to get always the same result, regardless of the document setting) without changing the background of the views.
Can you give me a hint?

Hi Wolfgang,

It is probably easier to just write your own version of CRhinoDoc::RenderToDC(), as it really isn’t that complicated.

The following code sample contains two functions that will do custom viewport capturing:

SampleRenderToDC() is really just a clone of CRhinoDoc::RenderToDC() that accepts a viewport background color as an argument.

SampleDrawDisplayModeToDC() is a more general purpose function that accepts any display pipeline attributes you want to throw at it.

cmdSampleCustomViewCapture.cpp

Let me know if this helps.

– Dale

Hi Dale,

your awesome. That’s really what i needed.

Thank you very much.