Transparent Icon problem

hi
I check the man page and the docs but could not find how to make an icon
transparent.

here is the code I am using atm

SDL_WM_SetCaption(“xxx”, “sanyo_icon” );
SDL_WM_SetIcon(SDL_LoadBMP(“data/n.bmp”), NULL);

can any one direct me to some further documentation on transparencys
please.

Regards

JG

Hypermedia Research Centre
Sanyo R&D Headquarters, Tokyo
http://www.sanyo.co.jp/R_and_D/3dm/
Tel: +81 (0)3 5803 3566
Fax: +81 (0)3 5803 3640
Email: jg at tk.hm.rd.sanyo.co.jp
Please use open standard file formats for attachments

J Grant wrote:

hi
I check the man page and the docs but could not find how to make an icon
transparent.

here is the code I am using atm

SDL_WM_SetCaption(“xxx”, “sanyo_icon” );
SDL_WM_SetIcon(SDL_LoadBMP(“data/n.bmp”), NULL);

can any one direct me to some further documentation on transparencys
please.

Regards

JG

Hypermedia Research Centre
Sanyo R&D Headquarters, Tokyo
http://www.sanyo.co.jp/R_and_D/3dm/
Tel: +81 (0)3 5803 3566
Fax: +81 (0)3 5803 3640
Email: jg at tk.hm.rd.sanyo.co.jp
Please use open standard file formats for attachments


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

the NULL there is meant to be used by a mask…this is an rtfm (again) issue…
http://sdldoc.csn.ul.ie/sdlwmseticon.php
a mask is another image which designates the transparency of the main image.
use values of black and white I think…I dunno which is transparent but trial and error will solve that.–
-==-
Jon Atkins
http://jonatkins.org/

http://sdldoc.csn.ul.ie/sdlwmseticon.php
i see that the mask is a transparency (Uint8 *) mask in MSB format.

well, hmm…, what is MSB format ?

Lloyd Dupont wrote:

http://sdldoc.csn.ul.ie/sdlwmseticon.php
i see that the mask is a transparency (Uint8 *) mask in MSB format.

well, hmm…, what is MSB format ?

A very good question; there are several plausible interpretations.
Here’s the real deal:

SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask)

If ‘mask’ is NULL:
If ‘icon’ is a colourkeyed surface:
the shape of the icon will be determined by the colour key
Otherwise:
the icon will have no transparency (will be an opaque rectangle)
Otherwise:
‘mask’ is a bitmap with bits set where the icon should be opaque.
The format of the mask is:
Scanlines come in the usual top-down order.
Each scanline consists of (width / 8) bytes, rounded up.
The most significant bit of each byte represents the leftmost pixel.

I’ll fix the docs

Hy, thanks for your precision,
anyway, hum, it is not totally clear…

Otherwise:
‘mask’ is a bitmap with bits set where the icon should be opaque.
The format of the mask is:
Scanlines come in the usual top-down order.
Each scanline consists of (width / 8) bytes, rounded up.
The most significant bit of each byte represents the leftmost
pixel.
you mean each bit in the mask represent one byte in the image ?
the correspondance is left to right…?
ok i believe it was simple to understand, it was just me who had a
trouble with my english, thanks for the precision.

I’ll fix the docs
great.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: text/enriched
Size: 721 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010911/20872832/attachment.bin

Lloyd Dupont wrote:

   The most significant bit of each byte represents the leftmost

pixel.

you mean each bit in the mask represent one byte in the
image ?

No, I meant what I wrote. Each bit in the mask represents a pixel.
Since the pixels are stored in an SDL_Surface, they can occupy one or
several bytes, depending on the surface’s pixel format

ok i believe it was simple to understand, it was just me who had a
trouble with my english, thanks for the precision.

If anyone else has problems with it please say so and I’ll rewrite it