Omega,
I don't think is a necessary a bad idea to have image list on each form.
Anyways, look at Icon class constructors, there are overloads that accept
size. Besically you load an icon form the resource and then create a new
Icon instance out of the loaded one specifying the size. This will extract
the icon with sepcified size.
Icon icon = new Icon(typeof(...), "MyIcon.ico");
Icon icon16 = new Icon(icon, 16,16);
There is also overlaod that accept stream and size. I think it works on the
same way, but never tried it.
As you can pick different image sizes there is no solution for getting same
size, but different color depth For example if you have and icon file with
images 16x16x16 and 16x16x256 you cannnot cotrol which one the Icon
constructor will pick. My test shows it picks 256-color one.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Omega" <om*****@gmx.net> wrote in message
news:qg********************************@4ax.com...
On Thu, 22 Dec 2005 09:38:05 -0500, "Stoitcho Goutsev \(100\) [C# MVP]"
<10*@100.com> wrote:
Omega,
Is the image list going to be shared at runtime also. I don't think this
is
a good OO design. If you need the image list just in design time you can
create and register a service upon loading your designer. Then you can
look
for this service and get the image list from there in all your designers.
Hi,
Sure, I want these images to be shared at rumtime also.
The problem: I have same buttons like 'Search' / 'Info' on different
forms,
the button has an icon on the left, I can choose the icon from the
ImageList which is already resized (16x16). Everything is ok but the
ImageList must be on every form.
I tried to create a resource for the project and add icons to it, it will
be global for all the forms in the project, in button's Image propertys I
then choose the resource icon but it can't be resized, it is always the
first icon in the Ico file (48x48).
Create and register a service ? I don't know how to do it ...
Omega