Use this to extract an image embedded as a resource in your project. Call the function supplying the full path to the resource, for example:
Dim myImage as Bitmap = EmbeddedIcon("MyApplication1.myImage.png")
Where "MyApplication1" is the root namespace for the project.
- Imports System.Reflection.Assembly
- 'returns an embedded resource image by name
- Public Function EmbeddedImage(ByVal Name As String) As Bitmap
- Return New Bitmap(GetExecutingAssembly.GetManifestResourceStream(Name))
- End Function
You need to login to post a comment.