473,789 Members | 3,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing Bitmap resource

Lee
Visual Studio 2.0 / XP Professional with all service packs

Assume the appropriate Using directives.

The following statements work:

ComponentResour ceManager resources = new
ComponentResour ceManager(typeo f(Resource1));
Bitmap ImageDown = new
Bitmap((Image)( resources.GetOb ject("ButtonDow n")));
Bitmap ImageUp = new
Bitmap((Image)( resources.GetOb ject("ButtonUp" ))));

but:

Bitmap ImageDown = new Bitmap(typeof(R esource1),
"ButtonDown ");

throws an exception saying that "ButtonDown " cannot be found in class
'TOSExportClien t.Resource1' ('TOSExportClie nt 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 8669
Check this out:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
http://msdn.microsoft.com/msdnmag/is...BasicInstincts

Good luck
chanmm

"Lee" <ls*****@inform ation-concepts.comwro te in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
Visual Studio 2.0 / XP Professional with all service packs

Assume the appropriate Using directives.

The following statements work:

ComponentResour ceManager resources = new
ComponentResour ceManager(typeo f(Resource1));
Bitmap ImageDown = new
Bitmap((Image)( resources.GetOb ject("ButtonDow n")));
Bitmap ImageUp = new
Bitmap((Image)( resources.GetOb ject("ButtonUp" ))));

but:

Bitmap ImageDown = new Bitmap(typeof(R esource1),
"ButtonDown ");

throws an exception saying that "ButtonDown " cannot be found in class
'TOSExportClien t.Resource1' ('TOSExportClie nt 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
2071
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 development in Delphi; flames about my tool choices will be gently dropped into the bit bucket) I'd be very thankful about any information regarding this matter. -- o-=< Richie Adler >=-o
3
10384
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 what I've done so far: (VS.NET 2003/C#) 1. Created an empty project for the resource dll. Output type is class library.
0
1584
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 ( this is an example with the resourse in a sub-folder called Resources): private void RegisterScript(Control targetControl) { String pageScriptName = "Cbs.Ui.Controls.Resources.ControlScript"; if (...
2
2641
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 bitmap created by right clicking on the project, selecting add new item, then add bitmap file). The project explorer says my bitmap is called "Bitmap1.bmp". If I have a function in my project declared as
2
1732
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 and the 2 web servers will be accessing the shared folder. Problem is, how can we access the shared folder without setting the permissions accesible to anyone? We read some articles about impersonation (impersonate the aspnet process to an account...
2
7291
by: Ivan Sammut | last post by:
Hi, Anyone can give me an example on how to load a bitmap from resource. Thanks Ivan
1
1790
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 function I want is actually to get the binary pixel to the (array??) and then setpixel (draw) after processing an image. (i.e. two images, one original one processed, are shown on the window at the same time) I found some classes that may be helpful to me...
1
1413
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 and I am not familliar with the SDK function? I searched on the web site and got an example as following, but it need load an actual bitmap resource. Now I have only the bm: case WM_PAINT: { BITMAP bm;
1
1346
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 : http://www.skystonesoftware.com/tempest/engine/?Site=87f3e857-12cd-426f-b36c-3ab9c19697ff&Page=aaec41cd-a505-4d06-a166-94929eb94d80&Entry=E6B04947-CE86-4C48-B8A8-D99BA936571F in the part code : Dim clsResourceStream As System.IO.Stream _ = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("WindowsApplication1.temp.txt") it...
0
9665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6768
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.