473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Retreiving an embedded resource (bitmap) from a DLL

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
2 2264
* =?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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Zentner | last post by:
Hi, I have a bitmap as an embedded resource. Now I want to use that bitmap for a background image of a button. But if I do the following it doesn't work. <snap start> Dim s As...
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
5
by: John J. Hughes II | last post by:
I use several embedded resources but sometimes have trouble determining their path. Currently I have one that will not work at all and was wondering what I did wrong. Name space is: MyApp Sub...
2
by: Eric Sabine | last post by:
I am trying to roll my own control and am a bit stuck with the bitmap. Private myBmp As Bitmap Public Sub New() Dim myStream As System.IO.Stream myStream =...
2
by: elziko | last post by:
I'm trying to use an embedded image(bitmap) using the following code: imgDrag = New System.Drawing.Bitmap(GetType(QueryResultGrid).Assembly.GetManifestResourceS...
2
by: Brian Henry | last post by:
If you embedded an icon into a dll, how would you get access to it form inside the dll and return it to the calling app? I know how to return it, just I cant figure out how to access the embedded...
7
by: H. Williams | last post by:
I know the .Net Cursor class doesn't work with color cursors. So I'm currently using the LoadCursorFromFile API with reflection to set color cursors: here is my code: public static extern...
3
by: C-Services Holland b.v. | last post by:
Hi all, I've created a custom button which I can stick into my toolbox. This all works well and I see my button in the designer. This button uses customised graphics and I want to stick it in...
6
by: CSharpProgrammer | last post by:
Hi, I followed an example that loads an embedded resource http://support.microsoft.com/kb/324567 That works just fine and dandy. My problem is that my namespaces are setup a bit differently....
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.