RhinoViewPort question

I would like to use a RhinoViewport object in a dialog for custom drawing purposes
but I see there is no SetScreenPort to set the size in pixels

Is there anyway to overcome this ?

thanks
gerry

            var views = Rhino.RhinoDoc.ActiveDoc.Views;
            if (views.Find("ViewName", true) == null)
            {
                int viewWidth = 300;
                int viewHeight = 300;
                views.Add(viewName, DefinedViewportProjection.Perspective, new System.Drawing.Rectangle(0, 0, viewWidth, viewHeight), true);
            }
            var view = views.Find("ViewName", true);

Run above C# stript to create a viewport with custom size 300 * 300.

Thanks, not really what I was searching for but useful

gerry

Hi @gerryark,

You might have a look at Rhino.UI.Controls.ViewportControl. Here is a Python sample:

SampleEtoViewports.py

I probably have a C# sample hiding somewhere, if needed.

– Dale

This seems what i need
I can do a port to c#
Thanks
Gerry

Could you share the C# port? thanks