I have a question: How do you load an embedded bitmap resource in C#? I
have tried the following but it doesn't seem to want to work:
Module mod = Assembly.GetExecutingAssembly().GetModules()[0];
IntPtr hInst = Marshal.GetHINSTANCE( mod );
bmToolbox = Bitmap.FromResource( hInst, "Toolbox.bmp" );
Please let me know the proper way to do this. I know I must be missing
something as this whole method seems round about to me.
Thanks,
Ted
The Windows Forms Tips and Tricks page has an article on the ToolboxBitmap
which shows how to locate a resource in the assembly. This will help you to
understand how the fully qualified name works.
http://www.bobpowell.net.tipstricks.htm
--
Bob Powell [MVP]
Visual C#, System.Drawing
All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Subscribe to the RSS feed at http://bobpowelldotnet.blogspot.com
to get notifications of all new GDI+ FAQ articles and Windows Forms Tips and
Tricks
"Ted Williams" <twil...@video-mation.com> wrote in message
news:OO72Q2K...@TK2MSFTNGP11.phx.gbl...
Rgds
*****http://www.smartcodeworks.com*******************************************
Find the webcontrols(Image Manager,calendar,Twinlist,outputmanager),Generic DB tools, free download and useful articles
***************************************************************************
----- Bob Powell [MVP] wrote: -----
Bitmap b = new Bitmap(typeof(myClass), "mybitmap.bmp");
include the bmp as an embedded resource in the same project as myclass.
Paul
"Ted Williams" <twil...@video-mation.com> wrote in message
news:OO72Q2K...@TK2MSFTNGP11.phx.gbl...