Creating and saving the semi-transparent picture in GflAx

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

User avatar
rozi
Posts: 3
Joined: Sat Feb 05, 2005 1:34 pm
Location: Slovenia

Creating and saving the semi-transparent picture in GflAx

Post by rozi »

Anybody had any success creating and saving semi-transparent PNG, TIFF or any other image file supporting alpha chanels in GflAx?

I have this GIF image, I transform it to RGB and then try to replace several colors with white transparency 0xFFFFFFFF:

Code: Select all

pic.ChangeColorDepth(AX_ToTrueColors);

pic.ReplaceColor(0x606060, 0xffffffff, 1);
pic.ReplaceColor(0x464646, 0xffffffff, 1);
pic.ReplaceColor(0xffffff, 0xffffffff, 1);
I need then to draw this picture on top of another one using alpha blend, but since DrawImage can draw only images stored on disk, I have to save my image first. But after examining the saved file I can't find any alpha information in it, regardles to say, the DrawImage draws it totaly opaque.
User avatar
xnview
Author of XnView
Posts: 45224
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Creating and saving the semi-transparent picture in GflA

Post by xnview »

rozi wrote:Anybody had any success creating and saving semi-transparent PNG, TIFF or any other image file supporting alpha chanels in GflAx?

I have this GIF image, I transform it to RGB and then try to replace several colors with white transparency 0xFFFFFFFF:

Code: Select all

pic.ChangeColorDepth(AX_ToTrueColors);

pic.ReplaceColor(0x606060, 0xffffffff, 1);
pic.ReplaceColor(0x464646, 0xffffffff, 1);
pic.ReplaceColor(0xffffff, 0xffffffff, 1);
I need then to draw this picture on top of another one using alpha blend, but since DrawImage can draw only images stored on disk, I have to save my image first. But after examining the saved file I can't find any alpha information in it, regardles to say, the DrawImage draws it totaly opaque.
Yes, it's a problem because AX_ToTrueColors convert the picture in 24bits, not in 32bits. So perhaps a new type AX_To32bits??
Pierre.