🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.ide.general
Article #27

Embedded Resources

#27
From: Jeff
Date: Mon, 11 Apr 2005 14:41
10 lines
1823 bytes
Hi,

I'm trying to use an embedded bitmap with C#Builder.

I used a example program called ResXGen that came with the .NET SDK to create a .resx file from my bitmap (named FontStyleButtons.bmp).  ResXGen takes a image file and the desired name for your resource (i used FontStyleButtons) and creates a .resx file.  So I added this .resx file (named resfile.resx) to my project.  When I build the project (the project name is Project) the file Project.resfile.resources is created in the directory containing resfile.resx.  I used another program called ResEditor (this came with the .NET SDK) to examine the Project.resfile.resources file and this program indicated that the file contains the correct bitmap resource.

The problem is that I can't seem to access the bitmap resource using the Bitmap constructor Bitmap(System.Type type, string resource).  I get an exception of class System.ArguementException.  What should the 2nd agruemennt to this constructor be?

By the way I'm trying to run the examples from Charles Petzold's book "Programming Microsoft Windows With C#".
Technical Details
Message-ID: <425a7e87$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 165859,7f4f6ce4d2a85945,start
X-Google-Attributes: gid165859,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jeff" <jeshort2@vt.edu>
Sender: "Jeff" <jeshort2@vt.edu>
Reply-To: "Jeff" <jeshort2@vt.edu>
Subject: Embedded Resources
Newsgroups: borland.public.csharpbuilder.ide.general
X-User-Info: 20.137.216.64     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <425a7e87$1@newsgroups.borland.com>
Date: 11 Apr 2005 06:41:27 -0800
X-Trace: newsgroups.borland.com 1113226887 207.105.83.66 (11 Apr 2005 06:41:27 -0800)
Lines: 10
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail