Hello
can you please explain in detail how to add a picture to the bar menu
I did as you created the class and announced the fields in the resources but the equal picture is not added?
can you please post the full example from VS 2019?
Thanks @Michael_Pryor for helping wrap our minds around this. Here is how I ended up using your recommendation with code, just because I’m not using VS.
using System;
using System.Drawing;
using System.Linq;
using Grasshopper;
using Grasshopper.Kernel;
namespace Plugin_1_Day_3
{
public class Plugin_1_Day_3Info : GH_AssemblyInfo
{
// all the name, icon, description, guid, etc stuff...
}
public class CategoryIcon : Grasshopper.Kernel.GH_AssemblyPriority
{
public override Grasshopper.Kernel.GH_LoadingInstruction PriorityLoad()
{
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
var resourceName = assembly.GetManifestResourceNames().Single(n => n.EndsWith("AverageIcon.png"));
var stream = assembly.GetManifestResourceStream(resourceName);
Bitmap dasIcon = new Bitmap(stream);
Grasshopper.Instances.ComponentServer.AddCategoryIcon("Workshop", dasIcon);
Grasshopper.Instances.ComponentServer.AddCategorySymbolName("Workshop", 'w');
return Grasshopper.Kernel.GH_LoadingInstruction.Proceed;
}
}
}
just wrapping things up after looking at this thread, being able to make icons makes all the difference!