473,396 Members | 1,816 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,396 software developers and data experts.

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 4608
Hi Dominique,

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

Dim objStream As System.IO.Stream
Dim objBitmap As System.Drawing.Bitmap

objStream =
System.Reflection.Assembly.GetExecutingAssembly.Ge tManifestResourceStream(resourceNamespace.resource Name)

objBitmap = New System.Drawing.Bitmap(objStream)

objStream.Close()

VB 2005 offers the use of the methods of My.Resources.ResourceManager.GetXXX

--

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**************@TK2MSFTNGP03.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.ResourceManager (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
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...
2
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
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...
0
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...
2
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...
2
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
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
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 =...
0
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,...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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,...

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.