Posted By

chavcho on 03/10/09


icon extract Resource embedded

Versions (?)

Extract an Icon Embedded as a Resource

 / Published in: VB.NET

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.

  1. Imports System.Reflection.Assembly
  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  

You need to login to post a comment.