I have the following code skeleton for a Grasshopper component I am making. Grasshopper 3D is a plugin for Rhino 3D, a piece of architecture software. It's a graphical programming language. Anyways, below is a sample Abstract Class, in which I am adding a Bitmap icon to the component.
namespace HM_SettingsForm
{
public class HM_Settings : GH_Component
{
// Misc code
protected override Bitmap Icon
{
get
{
return HM_SettingsForm.Properties.Resources.heatmap;
}
}
// Misc code
}
}
With that said, I am getting the following error.

Here is my Resources folder:

In my case, I was getting the same Error. What I was doing was I had been adding the image to Resources folder. It was adding it, right. but not the definition. So then I double clicked to the Resources.resx in Properties window. (not the resources folder) then I dragged and droped the image into the Resources.resx window. So That image is copied to resources folder and its definition as well . Hope it helps
Wow I am silly. I overlooked that I used HM_SettingsForm twice.
Simply doing: return Properties.Resources.heatmap; worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With