473,411 Members | 2,164 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,411 software developers and data experts.

Accessing Bitmap resource

Lee
Visual Studio 2.0 / XP Professional with all service packs

Assume the appropriate Using directives.

The following statements work:

ComponentResourceManager resources = new
ComponentResourceManager(typeof(Resource1));
Bitmap ImageDown = new
Bitmap((Image)(resources.GetObject("ButtonDown"))) ;
Bitmap ImageUp = new
Bitmap((Image)(resources.GetObject("ButtonUp"))));

but:

Bitmap ImageDown = new Bitmap(typeof(Resource1),
"ButtonDown");

throws an exception saying that "ButtonDown" cannot be found in class
'TOSExportClient.Resource1' ('TOSExportClient is the name of the dll).

Looking for the reason that the first form works and the second does
not.

--
// Lee Silver
// Information Concepts Inc.

Oct 14 '06 #1
1 8639
Check this out:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
http://msdn.microsoft.com/msdnmag/is...BasicInstincts

Good luck
chanmm

"Lee" <ls*****@information-concepts.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Visual Studio 2.0 / XP Professional with all service packs

Assume the appropriate Using directives.

The following statements work:

ComponentResourceManager resources = new
ComponentResourceManager(typeof(Resource1));
Bitmap ImageDown = new
Bitmap((Image)(resources.GetObject("ButtonDown"))) ;
Bitmap ImageUp = new
Bitmap((Image)(resources.GetObject("ButtonUp"))));

but:

Bitmap ImageDown = new Bitmap(typeof(Resource1),
"ButtonDown");

throws an exception saying that "ButtonDown" cannot be found in class
'TOSExportClient.Resource1' ('TOSExportClient is the name of the dll).

Looking for the reason that the first form works and the second does
not.

--
// Lee Silver
// Information Concepts Inc.

Oct 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richie Adler | last post by:
Does anyone know of a bitmap/resource/image collection for a Spanish card deck? I'm planning to create a new cardgame which requires this kind of deck (prototyping in Python and possible final...
3
by: J.Marsch | last post by:
Hello all: I am trying to build a resource dll that will house icons, and I'm afraid that I'm not having much luck reading it. Can you lend hand (or just point me to a good primer). Here's...
0
by: ChristianD | last post by:
for some reason i can't access a resource (.js) if the control files and the resource are in a subfolder off the project root or just the resource is in a subfolder. the code is as follows (...
2
by: Michael Murphy | last post by:
At the risk of being publically humiliated, might I ask the following simple question. I have a solution with one project. This project, WindowsApplication1, has one "form" and one "bitmap" (the...
2
by: baldwin | last post by:
Hello, We are going to have a web application that will be load balanced. Uploading documents into the same server is not an option. So we need to create a shared folder in a different machine...
2
by: Ivan Sammut | last post by:
Hi, Anyone can give me an example on how to load a bitmap from resource. Thanks Ivan
1
by: kenneth6 | last post by:
Give me some help, pls!! I am doing an image processing project. I decide to import some prepared binary images (in binary BMP format) into the resources sections of a MFC C++ project. The...
1
by: xqggz | last post by:
HI everyone, Now I have only the information of the BITMAP , but not an actual bitmap. I want to draw the bitmap according the BITMAP struction information, what can I do? I use the VC2005 Express...
1
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i need to load xml from a resource that is ousdie of my prject directory i this like :...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.