Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MAINICON 16x16, 32x32

141 views
Skip to first unread message

L.J.

unread,
Jul 22, 1998, 3:00:00 AM7/22/98
to
Simple question that I'm surprised I haven't asked in the past. How do you
get Delphi3 to adopt two mainicons? A 16x16 icon for when the small icon is
required for display (ie. small icons in explorer), or a 32x32 icon for
display when the large one is required (ie. large icons in explorer!).

If you peek in Microsoft (and other) applications, you will see multiple
icons of differing sizes and palettes all under the same title. I want the
MAINICON resource to hold two icons. Is this possible? ....or didn't they
think it was important?

Regards: L.J. * UK (lee@*nospam*.cafe-society.com)

G. Jacobs

unread,
Jul 22, 1998, 3:00:00 AM7/22/98
to
Just check for the current resolution and change the icon handle of the
application...
Of course, you have to create new icons in your resource...

Good luck,


G. Jacobs


Application.Initialize;
Application.CreateForm(TForm1, Form1);
case GetDeviceCaps(GetDC(Form1.Handle), HORZRES) of
640 : Application.Icon.Handle := LoadIcon (hInstance, 'ICON640');
800 : Application.Icon.Handle := LoadIcon (hInstance, 'ICON800');
1024 : Application.Icon.Handle := LoadIcon (hInstance, 'ICON1024');
1280 : Application.Icon.Handle := LoadIcon (hInstance, 'ICON1280');
end;
Application.Run;


L.J.

unread,
Jul 23, 1998, 3:00:00 AM7/23/98
to
Hi:

Thanks but that's not at all what I want to do. When explorer displays your
file, it jumps to the first icon resource and displays it.

However, if you look at a Microsoft exe (ie. notepad, etc.) you will notice
that under a single ResID, there are multiple icons. When Windows finds a
multiple instance, it grabs the one nearest to the current viewer size and
resolution. Your application doesn't decide because it hasn't even been
executed!

I have since found that these ResIDs which appear to contain Icons of
different sizes actually turn out to be a single icon file, but they contain
multiple icon bitmasks of different sizes. OK, I extracted one of these
'multiple icon' files and put it in my D3 project as the main icon. It
worked! Windows displayed the 16x16 icon provided when explorer was in
small icons mode and the 32x32icon provided when it was in large icons mode.

The problem? Well, I want to use my own icons but I can't put them together
because I can't find a shred of documentation. I've taken the 'supericon'
file apart but can't even find how the multiple bitmasks have been included
because they appear to be garbled.

If anyone knows where info can be found on these icons, I'd be grateful for
the info. Cheers: L.J.*UK lee@*nospam*cafe-society.com

K R M

unread,
Jul 23, 1998, 3:00:00 AM7/23/98
to
The easiest solution wuld probably be to use one of the many icon editors
available (AX-Icon, Microangelo, etc.) to create your own icon file, or if
you've access to Borlands (Imprise, whatever) Resource Workshop, it can
create icon resources with multiple sizes.

L.J. wrote in message <6p7jdm$pr...@forums.borland.com>...

Tony C. Wang

unread,
Jul 23, 1998, 3:00:00 AM7/23/98
to
L.J.

Use the image editor that came with delphi. you can store multiple images
in one file.

Respectfully,
--
Tony C. Wang
Professional Dental Technologies

L.J. wrote in message <6p7jdm$pr...@forums.borland.com>...

>Hi:
>
>Thanks but that's not at all what I want to do. When explorer displays
your
>file, it jumps to the first icon resource and displays it.
>
>However, if you look at a Microsoft exe (ie. notepad, etc.) you will notice
>that under a single ResID, there are multiple icons. When Windows finds a
>multiple instance, it grabs the one nearest to the current viewer size and
>resolution. Your application doesn't decide because it hasn't even been
>executed!
>
>I have since found that these ResIDs which appear to contain Icons of
>different sizes actually turn out to be a single icon file, but they
contain
>multiple icon bitmasks of different sizes. OK, I extracted one of these
>'multiple icon' files and put it in my D3 project as the main icon. It
>worked! Windows displayed the 16x16 icon provided when explorer was in
>small icons mode and the 32x32icon provided when it was in large icons
mode.
>

L.J.

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to
>Use the image editor that came with delphi. you can store multiple images
>in one file.


....really? You must tell me how you store multiple icons of differing
sizes in a single .ico file. Particularly with Image Editor which hasn't
been updated since the stone age.

I have a hnd in graphic design, yet I can't find a single tool which will
'join' these icons of different sizes into a single .ico file.

Regards:

L.J.

Ralph Friedman

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to
L.J.

Load Image Editor
File|New|Icon file
From the Icon properties dialog, select either 16x16 or 32x32 and the
appropriate color density
From the "Icon1.Ico" dialog press the New button.
Draw icons
Save file
The ico file will contain both icons.
--
Regards
Ralph (TeamB)
Herrsching, Germany

L.J. wrote in message <6p9def$rj...@forums.borland.com>...

J. R. Fitch

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to
MicroAngelo is available as Shareware from many websites.
One big advantage is that it creates 48x48 as well as 32x32
and 16x16, all in 16 and 256 colors.

My only quibble is that it doesn't have a Stretch function,
so I had to copy and paste with Photoshop to shrink the
48x48 image down to the smaller sizes.

Otherwise terrific program.
--
J. R. Fitch
Nine Dragons Software
351 Ulloa Street
San Francisco,
California 94127
415.664.3474 v.
415.564.3161 f.
www.ninedragons.com
jrf...@ninedragons.com

Dan K.

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to
IconForge, which I believe I read is also a Delphi app, lets you create the
mult-res ICO's. You can download a copy from http://www.cursorarts.com/

If you want to do your own, you can probably find the format for the icons
on Microsoft's site. A lot of icon-related stuff isn't documented very well,
if at all, however.

L.J. wrote in message <6p7jdm$pr...@forums.borland.com>...

L.J.

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to
< blush >

I haven't tried it yet but I'll take your word for it. I didn't think image
edit would be capable. I tried but got nowhere.

I'm using Microangelo now, but I've a little more faith in that thing I
called 'stone age' now!

Cheers & thanks! L.J.

jon...@bigfoot.com

unread,
Jul 25, 1998, 3:00:00 AM7/25/98
to
On Fri, 24 Jul 1998 08:15:19 +0100, "L.J." <cli...@clique.com> wrote:

>>Use the image editor that came with delphi. you can store multiple images
>>in one file.
>
>

>....really? You must tell me how you store multiple icons of differing
>sizes in a single .ico file. Particularly with Image Editor which hasn't
>been updated since the stone age.
>

>I have a hnd in graphic design, yet I can't find a single tool which will
>'join' these icons of different sizes into a single .ico file.

It used to be via the API and IconDir and IconDirEntry, but I no
longer see it in the Win32 API. I have the types in an old API
reference manual if they'd do you any good...

JE McTaggart

0 new messages