How to create a control like CRhinoUiBlockPreview?

rhino

#1

Hi,

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,
Picol


Generating custom thumbnails
(Dale Fugier) #2

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:

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleCommands/cmdSampleCustomViewCapture.cpp

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

– Dale


#3

Hi @dale,

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

Picol