Grasshopper

algorithmic modeling for Rhino

Hello everyone,

I'm trying to embed an image in the Right-Click->Help html.

I don't want to use a physical path as I'm storing the image in the resources file so I cannot simply use something like:

<img src=\"GH.Properties.Resources.crscAxis\">

I found this post online:

https://weblogs.asp.net/jeff/419842

and tried to follow it but it's not working for me.

In the AssemblyInfo.cs:

[assemblyWebResource("GH.Properties.Resources.releases""image/png", PerformSubstitution = true)]

And in my GH_Component:

protected override string HtmlHelp_Source()        
{           
Page p = new Page();
p.ClientScript.GetWebResourceUrl(this.GetType(), "GH.Properties.Resources.crscAxis");

....
}

Thanks for help!

Views: 287

Replies to This Discussion

I'd recommend saving your images from resources into a Temp folder (you can always check first to see if they are already there, then you don't have to export them again). You must then modify your HTML code to point to these absolute paths.

All right, thanks David!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service