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

getting small icon from embded icon resource

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!
Nov 17 '05 #1
1 2087
using the MultiIcon class (http://www.codeproject.com/dotnet/MultiIcon.asp),
just change icoStream from type 'IO.MemoryStream' to type 'IO.Stream'

You can then use GetManifestResourceStream().

\\\
System.Reflection.Assembly Assy =
this.GetType().Assembly.GetExecutingAssembly();

thisIcon = new multiIcon(Assy.GetManifestResourceStream(
"myNameSpace.App.ico"))
///
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Brian Henry" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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!

Nov 17 '05 #2

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

Similar topics

3
by: Kendall Gifford | last post by:
Greetings. While trying to get a simple app working, I've been forced to delve into embedded and/or linked resources a bit. I read all the reference for the System.Resources namespace as well as...
4
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was...
2
by: Jack | last post by:
I was learning Windows programming in C# using Charles Petzold book, but this book was written for the older version of .NET. The example of using icon from embedded resource fails to work when...
3
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my...
6
by: farseer | last post by:
Hi, I created a new resouce ("app.resx") in my project and added an icon to this resource with name "IL_ICON". I would like to use this resource in some unmanaged code, in particular, with the...
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...
5
by: Tom | last post by:
I have a main VB.NET application that loads another VB.NET DLL dynamically. Once I have done that, I would like to be able to 'get' the icon of a form in that dynamically loaded DLL. How would...
3
by: UJ | last post by:
I have an icon file stored as part of a program as a resource (Embedded Resource). How can I get the file out of the resource to be able to set a window's icon to the icon? (I know the icon is...
4
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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,...
1
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
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.