How to make "Icon" for my custom panel (Rhinocommon)

I made my plugin that have my panel.
I want to set an icon for this ,visible in layered tab.

But I’m not sure what size and color is good for rhino panel Icon.
I think I can create icon data using Visual Studio.

    protected override Rhino.PlugIns.LoadReturnCode OnLoad(ref string errorMessage)
    {
        Rhino.UI.Panels.RegisterPanel(this, typeof(MyPanel), "MyPanel", System.Drawing.SystemIcons.Application, 0);
        return Rhino.PlugIns.LoadReturnCode.Success;
    }

I’d like to change “System.Drawing.SystemIcons.Application” to an Icon that indicates my panel function.

It differs slightly if its Eto, WinForms or Wpf, but in general you add a icon resource to your project and then reference that instead of System.Drawing.SystemIcons.Application. The samples for Eto,Winforms, Wpf all show setting icons…

Winforms => rhino-developer-samples/rhinocommon/cs/SampleCsWinForms/SampleCsWinFormsPlugIn.cs at 8 · mcneel/rhino-developer-samples · GitHub

Eto => rhino-developer-samples/rhinocommon/cs/SampleCsEto/SampleCsEtoPlugIn.cs at 8 · mcneel/rhino-developer-samples · GitHub

Wpf => rhino-developer-samples/rhinocommon/cs/SampleCsWpf/Commands/SampleCsWpfPanelCommand.cs at 8 · mcneel/rhino-developer-samples · GitHub

This tutorial shows how to add icon resources to a project: https://youtu.be/hdW3JVA0k8o?t=370

2 Likes

Thanks ! It was very helpful.

1 Like