By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,937 Members | 2,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,937 IT Pros & Developers. It's quick & easy.

Retreiving an embedded resource (bitmap) from a DLL

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* =?Utf-8?B?SnVsaWEgQmVyZXNmb3Jk?= <an*******@discussions.microsoft.com> scripsit:
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'...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
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?
Many thanks for any help with this.

Julia Beresford

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 12/05/2004
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.