Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Icons from embedded resources for ribbon bar

Hello everybody!
I am trying to use the c# API example code to access the ribbon bar:

RibbonButton button1Panel1 = new RibbonButton();
button1Panel1.ToolTip = "1";
button1Panel1.Text = "This is a managed ribbon button ...";
button1Panel1.CommandParameter = "command1";
button1Panel1.ExternalImage = true;
button1Panel1.Image = "icon1.bmp";
button1Panel1.Id = "1";

The code is working (icon is shown) if the file "icon1.bmp" is available under the directory "C:\Program Files\Bricsys\BricsCAD V20 de_DE\Support".
Now i would like to use an Icon out of the embedded resource file, which is compiled into the *.dll.
The common c# syntax should be like this:

button1Panel1.ExternalImage = true;
button1Panel1.Image = "CADPlugin.Resources.icon1.bmp"; // SOLUTION_NAME.Resources.FILENAME.FILETYPE

Using this Syntax the icon could not be found.

The API in AutoCAD is a little different: in AUTOCAD it is possible to set an icon directly by an image_object, not by its path: button1Panel1.Image = CADPlugin.Resource1.icon1; // this is the image reference, not a path

Is there any solution to use an icon from embedded resources?
please help, kind regards, waldo

Sign In or Register to comment.
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam