Retreiving an embedded resource (bitmap) from a DLL

G

Guest

Hi Al

You can add a Bitmap to a VB class library and set it’s build action to embedded resource. How do you then get that image (i.e. load it into a PictureBox control) from another vb application knowing only the name of the DLL and of the Bitmap

Many thanks for any help with this

Julia Beresfor
 
H

Herfried K. Wagner [MVP]

* =?Utf-8?B?SnVsaWEgQmVyZXNmb3Jk?= said:
You can add a Bitmap to a VB class library and set it’s build action to embedded resource. How do you then get that image (i.e. load it into a PictureBox control) from another vb application knowing only the name of the DLL and of the Bitmap?

I would provide a method in the class library that takes the ID and returns an 'Image'...
 
M

Mick Doherty

Assuming you have a Dll with the Namespace MyDll and the embedded resource
MyBitmap.bmp resides in the class MyResources and there is a reference to
the dll in your project.

Picturebox.Image = New Bitmap(GetType(MyDll.MyResources), "Bitmap.bmp")

note that the resource name is cAse sEnstive. i.e. Mybitmap.bmp <>
Mybitmap.BMP


Julia Beresford said:
Hi All

You can add a Bitmap to a VB class library and set it's build action to
embedded resource. How do you then get that image (i.e. load it into a
PictureBox control) from another vb application knowing only the name of the
DLL and of the Bitmap?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top