Extract an Icon Embedded as a Resource


/ Published in: VB.NET
Save to your folder(s)

Use this to extract an icon embedded as a resource in your project. Call the function supplying the full path to the resource, for example:

Dim myIcon as Icon = EmbeddedIcon("MyApplication1.myicon.ico")

Where "MyApplication1" is the root namespace for the project.


Copy this code and paste it in your HTML
  1. Imports System.Reflection.Assembly
  2.  
  3. 'returns an embedded resource icon by name
  4. Public Function EmbeddedIcon(ByVal Name As String) As Icon
  5. Return New Icon(GetExecutingAssembly.GetManifestResourceStream(Name))
  6. End Function

Report this snippet


Comments


You need to login to view comments.