algorithmic modeling for Rhino
Hi all,
I'm learning to use VS 2010 ( C#, Express ) and have written a simple component.
It works, until I try to give it an icon.
In the project's Properties, I loaded the image file under Resources,
and then I saw under Application that resources are managed by 'Icon and manifest'.
That can also be set as 'Resource file', but then a file path is required.
Is 'Icon and manifest' OK, or have I to set thing differently ?
Also, in the class code I inserted the following:
( I saw it mentioned here in the forum )
protected override Bitmap Icon
{
get { return Resources.colour; }
}
( colour.png is the image file's name )
but VS gives me an error, saying:
Error 1 The name 'Resources' does not exist in the current context C:\Program Files\Rhinoceros 5 Evaluation\gh\plug-ins\ColourRhOb\Class1.cs 88 26 ColourRhOb
Did I miss a reference in the code ? Here they are:
using System;
using System.Drawing;
using System.Collections.Generic;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Types;
using Rhino;
using Rhino.DocObjects;
using Rhino.Geometry;
What am I doing wrong ?
Thanks
emilio
Tags:
try Properties.Resources.colour? I think it's something like that...
Thanks a lot, Andrew !
'Properties' is exactly what I was missing.
Cheers
emilio
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by