Re: [AD] Proposal for a set_icon function |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
----- Original Message -----
From: "Javier González" <xaviergonz@xxxxxxxxxx>
To: "Allegro Conductors" <conductors@xxxxxxxxxx>
Sent: Monday, August 06, 2001 2:19 PM
Subject: Re: [AD] Proposal for a set_icon function
> > > It would be more useful if it can be done by using a regular Allegro
> > bitmap.
>
> >What I was thinking was something like:
>
> >int set_app_icon(BITMAP *large_icon, BITMAP *small_icon)
>
> >Where large_icon is a 32x32 bitmap and small_icon is a 16x16 one. If
> >one of them is not present, it is generated by stretching the other
> >one. If both are NULL, the default application icon for the running
> >platform is set. The function returns 0 on success.
>
> >My idea is that this function sets the icon at runtime, but possibly as
> >a resource of the program, so that once set, the new icon remains
> >attached to the application file also while it is not being executed.
>
> I only can talk about windows, were it would be very easy to set the
windows
> icon by getting an allegro bitmap and converting it to an ICO in memory
> (HICON) and then changing the window class icon parameter
>
> that is of course only for the window
>
> about that about attaching a resource to an exe inside the same program
(at
> least
> in windows) is very difficult, if not impossible
>
> the user can attach a resource file with an icon (this is compiling with
the
> resource
> compiler and then linking with the linker) to have that icon available in
> the exe though, wich is not very difficult and not allegro incompatible
(the
> first icon in the
> the resource in the exe is taken as the windows application default icon)
>
> well, m 2 cents =)
What about:
int set_app_icon(void *icon, int icontype, int w, int h, int depth)
where icontype specifies the source as, say, ICON_ALLEGBITMAP or
ICON_WINDOWS, w and h specify the dimentions for those platforms that
require it, and depth specifies the color depth for those platforms that
require it. This way we can either use Allegro bitmaps or icons stored as
Windows resources, or Mac resources, or whatever the native icon resource is
for a platform...
--Chris