473,698 Members | 2,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to extract icon (or resource) ?

Hi,

In VB 2005, How to extract icons (or images or other resources) from a file
..resx, .resource, .dll or .exe and then to create a new file with this
resource (.ico, .jpg ..) ?

Thanks

Dominique

Apr 19 '06 #1
2 4639
Hi Dominique,

The general approach is to get the resource stream using
Assembly.GetMan ifestResourceSt ream with the full qualified name for the
resource (namespace.reso urcefile, case sensitive), and then you use the
image constructors that take a stream as input parameter:

Dim objStream As System.IO.Strea m
Dim objBitmap As System.Drawing. Bitmap

objStream =
System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetManifestR esourceStream(r esourceNamespac e.resourceName)

objBitmap = New System.Drawing. Bitmap(objStrea m)

objStream.Close ()

VB 2005 offers the use of the methods of My.Resources.Re sourceManager.G etXXX

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"DG78" <DG**@community .nospam> escribió en el mensaje
news:eM******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

In VB 2005, How to extract icons (or images or other resources) from a
file .resx, .resource, .dll or .exe and then to create a new file with
this resource (.ico, .jpg ..) ?

Thanks

Dominique

Apr 19 '06 #2
Hi Carlos,

Thanks you very much for your answer.
I think the solution in VB 2005 is with My.Resources.Re sourceManager (many
links in google and an article in msdn number of may 06).

Cheers

Dominique
Apr 19 '06 #3

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

Similar topics

0
1376
by: Haim Ashkenazi | last post by:
Hi I'm trying to build a binary with py2exe. I've used the method suggested in the py2exe wiki about adding icon resources to apps. it build ok on win2k, but when I try to build the same on win98 I get this error: copying C:\Python23\Lib\site-packages\py2exe\run.exe -> C:\My Documents\NS_Backup\dist\NS_Backup.exe Traceback (most recent call last): File "Setup.py", line 13, in ?
2
3542
by: Joe Wong | last post by:
Hi, I have encountered an error whenever I put the "icon_resources" line in my setup.py file: from distutils.core import setup import py2exe setup(
1
2116
by: Brian Henry | last post by:
I have an icon in my app as an embeded resource.. i am accessing it through the assemblies getmainfestresourcestream method of the assembly. The icon has a 32x32 and a 16x16 icon in the same icon resource, I want to draw the 16x16 one on the screen, how would I do this? the only icon i get back when making a icon object out of it is 32x32.. but i need the smaller one, thanks!
0
2970
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of numbers in sequential order (1-55 when ran against iexplore.exe). When I open up iexplore.exe in Visual Studio, I see 23 icons. Each icon has 1 or more sizes of the icon...I'm assuming that there are, in fact, 55 icon resources in iexplore.exe,...
2
1874
by: Spam Catcher | last post by:
Hi all, Does .NET provide any native API calls to extract .DLL/.EXE icon files based on IconIndex? Is there a way to enumerate through all the icons in an assembly (.NET or Native code assemblies)? Thanks!
2
1569
by: | last post by:
Hello, Can anyone provide me some code snippets, or a class that would allow me to extract icons from an executable file? thank you Learner.
0
938
by: Steve McKewen | last post by:
Found it. You have to use the ToBitmap method in the Icon object, then that will convert to an Image. Image^ aImage = theIcon->ToBitmap(); Steve
7
2342
by: =?Utf-8?B?QmVu?= | last post by:
Hi I am looking for a way to extraxt an icon from a .exe file an save it as an icon not a bitmap or jpeg to a file? The code below extracts the icon but only as a bitmap PictureBox1.Image = Drawing.Icon.ExtractAssociatedIcon("file.exe").ToBitmap The problem is I need the icon not the bitmap.
0
2358
by: Sathyaish | last post by:
I want to get the icon from an IE shortcut (.url) file without passing a new WebRequest to the server. The .url is an INI file that has the path to the original URI where the icon file resides, but I don't want to make a new web request. Surely the file must be somewhere already on the local system. Is there a way to get it?
0
9157
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
8895
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
8861
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...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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
4369
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
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.