Print Page | Close Window

Non transparent PNGs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=19438
Printed Date: 18 June 2025 at 9:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Non transparent PNGs
Posted By: Michl
Subject: Non transparent PNGs
Date Posted: 26 January 2012 at 6:07am
Hello,

if I use png pictures with only 3 channels (rgb), is it possible that this pictures are always invisible?
I wondering about following code in CXTPGraphicBitmapPng::ConvertToBitmap:


        for (xImg = 0; xImg < szImage.cx; xImg++)
        {
            r = *src++;
            g = *src++;
            b = *src++;
            *dst++ = b;
            *dst++ = g;
            *dst++ = r;
            a = 0;

            if (cImgChannels == 4)
            {
                a = *src++;
            }
            *dst++ = a;
        }

0 is treated as "fully transparent", is that right?
Should this value not be 255 (0xFF)?

Michael



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net