473,662 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resource Files & Image Extraction Help Win[C#]

I'm having trouble extaction my image from my resource file using
DictionaryEnume rator & ResourceReader. String extractions are good.

I've been trying to look online for exact info on this, but alas, I can't
find any and I am not sure if this is possilbe. My code sample below and any
and all help is appreciated.

//This part works just fine
private void Save_Click(obje ct sender, System.EventArg s e)

{

try

{

ResourceWriter rw = new ResourceWriter( @"C:\HOST_BACHE ND.resources");

//

rw.AddResource( "LOGO", this.pBox_Logo. Image);

rw.AddResource( "HEADER_1", "HEADER TEST");

//

rw.Generate();

rw.Close();

}

catch(Exception myException)

{

MessageBox.Show (myException.Me ssage);

}

}

----------------------------------------

//Extraction is the problem for just the image

try

{

IResourceReader reader = new ResourceReader( @"C:\HOST_BACHE ND.resources");

IDictionaryEnum erator en = reader.GetEnume rator();

//

while (en.MoveNext())

{

MessageBox.Show (en.Key.ToStrin g() +"\n" + en.Value.ToStri ng()

+"\n" + en.Current.ToSt ring() +"\n" + en.Entry.ToStri ng());

if(en.Key.ToStr ing() == "LOGO")

{

??????

}

if(en.Key.ToStr ing() == "HEADER_1")

{

MessageBox.Show (en.Value.ToStr ing());

}

}

}

catch(Exception myException)

{

MessageBox.Show (myException.Me ssage);

}
Thanks

MikeY
Jan 22 '08 #1
0 1171

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

Similar topics

2
1251
by: Brian Henry | last post by:
does anyone know how to extract resource files from .NET applications? Being they are not standard resource files like the old Win32 ones (the .res files), ,is there any applications or such that have the ability to do this? or any source code on how to do it? thanks
0
1207
by: MikeY | last post by:
With Reference/Resource is there a way of embedding the .resource file within a folder of my application instead of having it in the main project /executing assembly area. i.e. if I have a folder pertaining to variables, I would like to have that "variables.resource" file within that folder and be able to call it from there instead of calling it from the executing assembly area. So far I am unable to figure out the complete syntax of...
2
3497
by: Don Tucker | last post by:
Hello, I have a Windows Application that needs to load multiple image files in response to users clicking buttons. Currently, I just have these images as .jpg files on disk, but I don't want to have to migrate the files everywhere that the executable is installed. Is there a way to add them to a Visual Studio solution/project so that they are embedded in the application somehow? If so, how do I access the images when needed? Thanks,...
11
1968
by: Alan T | last post by:
I added a resource file into my project, to store the caption of buttons and labels.. How do I make use of this resource file to dynamically assign to the buttons and labels ?
1
2108
by: Chukkalove | last post by:
I originally created several "copy" resource reader classes which worked great individually, but after I converted them into an parent class with children they no longer find the resources. Each project contains its own reader class and resource .resx file from where a string or image is read. Can someone tell me what I need to do to get them to work please. I attach code. Im not sure if it's because the derived classes are in...
8
13658
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info for the setup, and compiles the whole thing into one EXE. How do i embed resources, and access them, into that assembly?
3
2143
by: nor | last post by:
Hi, I've application to capture video of image and grab the still image. It runs well until I put loop to regrab the still images many times automatically. It gives one exception error: NullReferenceException was unhandled  ”Object reference not set to an instance of an object". I found that, this error come out because of calling file from outside of the main code of the programming. These are the code that calling file from the outside...
7
2102
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of the images that are used for icons across all of the forms in all of the assemblies in a single resource file so that swaping out an image in the resource file affects all localtions that it appears in the app. Is there a way to create a single...
2
7233
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've added some ICO Images to some buttons on my forms. I added them by selecting an Image via the "Select Resource" window. Anyway, all of my images are working just fine, I am getting a WARNING message that says - Resource Name "Picture Image Name" is not a valid Identifier. I don't understand what this is telling me. I prefer my projects to have no warning messages all and I would like ot fix what ever the problem is here. I have...
0
8432
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
8856
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...
1
8545
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
8633
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
7365
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5653
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
4179
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...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.