How to create a control like CRhinoUiBlockPreview?


I want to show some custom object dynamically on a MFC control, just like CRhinoUiBlockPreview, instead of associating with a block instance. In other words, i want to use a control to draw the real-time preview of one or more objects when i modify its attributes on its config dialog.

Can i use CRhinoDisplayPipeline directly to achive it, and how?

Best regards,

Hi Picol,

CRhinoUiBlockPreview is an owner-drawn static control that draws a bitmap preview image of an instance definition.

The image is generated by creating an invisible CRhinoViewport that has a custom CRhinoDisplayConduit that draws into it. The resulting image is captured to a device-independent bitmap, just as you would if you were capturing a regular Rhino viewport:

Sorry there isn’t a sample for this. Is this enough information to get you started?

– Dale

Hi @dale,

I’ve made it with help of your reply.
Thank you very much!