This site is no longer active and is available for archival purposes only. Registration and login is disabled.

ColorKey with PNG files


ColorKey with PNG files

Postby simont » Sep 2, 2002 @ 12:10pm

simont
pm Member
 
Posts: 4
Joined: Sep 2, 2002 @ 11:53am
Location: South of England


Postby Johan » Sep 2, 2002 @ 12:32pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby simont » Sep 2, 2002 @ 1:02pm

simont
pm Member
 
Posts: 4
Joined: Sep 2, 2002 @ 11:53am
Location: South of England


Postby simont » Sep 3, 2002 @ 9:34am

simont
pm Member
 
Posts: 4
Joined: Sep 2, 2002 @ 11:53am
Location: South of England


Postby Johan » Sep 3, 2002 @ 11:12am

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby simont » Sep 5, 2002 @ 11:10am

simont
pm Member
 
Posts: 4
Joined: Sep 2, 2002 @ 11:53am
Location: South of England


Postby Johan » Sep 5, 2002 @ 11:30am

Hi,

Ok, I know what's wrong here. This is not related to GapiDraw.

GapiDraw uses a built in library in the Pocket PC called IMGDECMP.DLL. This library is responsible for decoding GIF, JPG and PNG images.

IMGDECMP.DLL however has a severe bug where transparent parts in GIF and PNG images ALWAYS are filled with white color! So if you have a GIF or PNG image, even if the transparent parts are set to render as black the Pocket PC will always render them as white.

Why does IMGDECMP.DLL do this? Simple - it's due to a bug in Pocket Internet Explorer. :) Create an image consisting of some pure white elements. Make some parts of the image transparent and save as GIF. Create a colored web page and place your GIF there. When shown in Pocket IE ALL white elements of your picture will be transparent. Basically the process works like this:

(1) IMGDECMP.DLL: Load GIF or PNG. Replace all transparent parts with white color. Send image to Pocket IE.
(2) Render background on web page. Take image from IMGDECMP.DLL. Replace all white parts with background. So what if the picture contains white elements that should not be transparent, all web pages are white anyways in my world.

You can clearly see this error if you open the web page http://www.opentrek.com/ in Pocket Internet Explorer. Check the main logo for black dots (they should be white).

GapiDraw sets the correct flags in calling the IMGDECMP.DLL, so if IMGDECMP.DLL is corrected in a future PPC update (not very probable) GapiDraw would work ok on these future devices.

Until then: Stay away from transparent PNGs and GIFs. Always make them opaque and draw "transparent" parts with for example a pink color.

I will update the documentation on CreateSurface and SetColorKey / GetColorKey to also reflect PNG images.

/Johan
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron