Document RenderToDC not working?

Hi everyone. I am trying to render the viewport to a device context using the RenderToDC. I am creating a new CRhinoDib object and then call

dib.CreateDib(rect.Width(), rect.Height(), 24, true)

I then make a call to

context.m_doc.RenderToDC(it, dib, dib.Width(), dib.Height(), view->ActiveViewport().View())

but this does not actually seem to render anything to the dc, every pixel is black. I know that the iterator is valid because i have checked and it contains the objects i have selected.
I cannot find any documentation about RenderToDC except the description in the rhino sdk header file which says to do it exactly like i am doing it.
Anyone knows what i might be missing?


Hi @Christos_Spathis,

Unless you are using Rhino 5, CRhinoDoc::RenderToDC is obsolete, as it is not cross platform.

Here is what you want to do in Rhino 6 and above.


– Dale

1 Like

@dale that is exactly what i needed. Thank you!