Results 1 to 2 of 2

Thread: Color-key transparency

  1. #1
    Serf
    Join Date
    Jan 2010
    Posts
    1

    Default Color-key transparency

    I've seen similiar question asked several times, but still... Is there any way to load CL_Sprite from resources with color-key transparency? I mean, alpha-channel is all good and nice, but surely such a simple thing is NOT missing from well-estabilished library?

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    If I remember correctly, ClanLib 1.0 used to be able to do this, but it was taken out during the ClanLib 2.0 development.

    The reason was because changes to the ClanLib internals broke the color key in the CL_SpriteDescription, and nobody wanted to fix it. I think this was because it was thought that is was not required.

    There are 3 choices
    1) Submit a patch to fix it
    2) Create a small utility that converts the colorkey RGB PNG to a RGBA PNG
    Code:
    CL_PixelBuffer image = CL_PNGProvider::load(filename);
    work_buffer = image.to_format(CL_PixelFormat::rgba8888);
    (use work_buffer.get_data() and convert it
    CL_PNGProvider::save(work_buffer, "image.png");
    3) Use the other methods to convert to RGBA - http://www.rtsoft.com/forums/showthread.php?t=2943

Similar Threads

  1. canvas can not run in 16bit color?
    By silekey in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 09-13-2007, 02:45 AM
  2. [PATCH] Color interpolation
    By Mange in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-01-2007, 08:50 AM
  3. Feature Request - Shadow Direction and Color
    By loken in forum Novashell Game Creation System
    Replies: 3
    Last Post: 01-12-2007, 08:10 PM
  4. Automatic "transparency" ?
    By whisperstorm in forum Novashell Game Creation System
    Replies: 3
    Last Post: 01-10-2007, 07:58 PM
  5. I am having color inversion problems
    By in forum Dink Smallwood HD
    Replies: 2
    Last Post: 08-13-2004, 06:50 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •