Embedded resources and the res protocol

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

    Embedded resources and the res protocol

    Hi,

    How do I embed a picture (gif for instance) in a dll using VB.NET so
    that the picture can be used in a html page with the res protocol?

    I have tried adding pictures (as Embedded resources) to my class
    library and then accessing them from html with
    <IMG SRC="res://ResLib.dll/GIF/ResLib.testpic. gif">

    The name "ResLib.testpic .gif" comes from
    System.Reflecti on.Assembly.Get ExecutingAssemb ly().GetManifes tResourceNames( )

    Thanks in advance,
    Dan
  • Charles Law

    #2
    Re: Embedded resources and the res protocol

    Hi Dan

    AFAIK .NET does not recognise the res protocol. If you have access to Visual
    Studio 6, I would use it to create a dll in which you include your gifs. You
    can then use the res protocol to include them by number. For example

    res://c:\myproject\re source.dll/GIF/202

    HTH

    Charles


    "Dan" <dan@iregren.co m> wrote in message
    news:7d93f194.0 405301201.3fdc9 796@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > How do I embed a picture (gif for instance) in a dll using VB.NET so
    > that the picture can be used in a html page with the res protocol?
    >
    > I have tried adding pictures (as Embedded resources) to my class
    > library and then accessing them from html with
    > <IMG SRC="res://ResLib.dll/GIF/ResLib.testpic. gif">
    >
    > The name "ResLib.testpic .gif" comes from
    >[/color]
    System.Reflecti on.Assembly.Get ExecutingAssemb ly().GetManifes tResourceNames( )[color=blue]
    >
    > Thanks in advance,
    > Dan[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Embedded resources and the res protocol

      * dan@iregren.com (Dan) scripsit:[color=blue]
      > How do I embed a picture (gif for instance) in a dll using VB.NET so
      > that the picture can be used in a html page with the res protocol?
      >
      > I have tried adding pictures (as Embedded resources) to my class
      > library and then accessing them from html with
      > <IMG SRC="res://ResLib.dll/GIF/ResLib.testpic. gif">
      >
      > The name "ResLib.testpic .gif" comes from
      > System.Reflecti on.Assembly.Get ExecutingAssemb ly().GetManifes tResourceNames( )[/color]

      This doesn't work with managed resources. You will have to add
      unmanaged (Win32) resource to your application:

      <URL:http://dotnet.mvps.org/dotnet/samples/codingtechnique/downloads/ResourceIcons.z ip>

      --
      Herfried K. Wagner [MVP]
      <URL:http://dotnet.mvps.org/>

      Comment

      Working...