User avatar
johan
GpsGate
Posts: 14392
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Why is my icon not transparent when drawn on map?

Thu Jan 19, 2006 2:24 am

Why is my icon not transparent when drawn on map?

If you have set a transparent color on a GIF and import it into a MapLib it will keep the transparent color when drawn on a map at runtime.

Another way is to set the transparent color at runtime using IconData.Background
http://franson.com/gpstools/reference_m ... atform=net

First create a Brush object and then set IconData.Background with that new Brush object. Using this method you can make BMP icons transparent as well as GIF icons.

But sometimes both those methods fail.

If you have a icon that contains 16 or 256 colors and the color you use as transparent color exists in several places in the color palette, you must use the lowest index for the pixels that you want to be transparent.

E.g. if you have chosen white to be transparent (RGB value 255,255,255). And white exists at index 1, 32 and 254 in the image palette. Only pixels with index 1 will be transparent.

Regards,
Johan

Franson Support

Return to “Knowledge base GpsTools”