Posted By

chavcho on 03/10/09


image extract bitmap Resource embedded

Versions (?)

Extract an Image Embedded as a Resource

 / Published in: VB.NET

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.

  1. Imports System.Reflection.Assembly
  3. 'returns an embedded resource image by name
  4. Public Function EmbeddedImage(ByVal Name As String) As Bitmap
  5. Return New Bitmap(GetExecutingAssembly.GetManifestResourceStream(Name))
  6. End Function

Report this snippet  

You need to login to post a comment.