Hello Bob,
From your description, you're wantting to programmatically extract icon
images(multiple) from a .ico file (or some other win32 resource file like
exe or dll), right?
Based on my research, for such cases that we need to load win32 resources
from a certain resource image in .net framework code, the most common way
is manually parse the ico file based on its file structure. For exe and
dll, since there are existing win32 API to load and extract resource, you
can use PInvoke to call some unmanaged API in your .net code. I have found
the following two web articles which has provide some code on reading
multipe icons from ico and other resource image:
#Access multiple icons in a single icon file
http://www.codeproject.com/dotnet/MultiIcon.asp
#IconLib - Icons Unfolded (MultiIcon and Windows Vista supported)
http://www.codeproject.com/useritems/IconLib.asp
also, following is a project which originally created via VB and rewritten
in C#, it is also quite a good example for your reference:
#.NET Icon explorer
http://www.vbaccelerator.com/home/NET/Utilities/Icon_Extractor/IconExplorer.
asp
Hope this helps you.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.