VoyForums

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123456[7]8910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 17:41:50 11/09/01 Fri
Author: Michel
Subject: Re: BMP to Transparent PNG for IE
In reply to: Brett 's message, "Re: BMP to Transparent PNG for IE" on 04:28:18 11/09/01 Fri


Hi Brett,

I am not sure what is the problem. This seems to be coming from libpng.

I would remove a few lines which are not necessary. Also, you have a Transparent property which is not available in the latest version. Do you have version 1.1?

Try this as a first test,

gGraphic2 := TPNGGraphic.Create;
gGraphic2.LoadFromFile( 'c:\tbbn3p08[1].png' );

gGraphic2.SaveTransparent := True;
gGraphic2.TransparentColor := gGraphic.RGB[ 0, 0 ];
gGraphic2.SaveToFile( 'c:\tbbn3p08[1]10.png' );
gGraphic2.Free;

Also, what is the value of gGraphic2.ImageFormat after LoadFromFile?

Best regards,

Michel


>My appolgises for not noticing the related threads in
>the archives before posting. I have used one of them
>to progress. Unfortunately I get a error on saving:
>
> 'Invalid number of transparent colors specified'
>
> gGraphic2 := TPNGGraphic.Create;
> gGraphic2.SaveProgressive := True;
> gGraphic2.SaveTransparent := True;
> gGraphic2.LoadFromFile( 'c:\tbbn3p08[1].png' );
> gGraphic2.SaveTransparent := True;
> gGraphic2.SaveProgressive := True;
> gGraphic2.Transparent := True;
> gGraphic2.TransparentColor := gGraphic.RGB[ 0, 0 ];
> gGraphic2.SaveToFile( 'c:\tbbn3p08[1]10.png' );
> gGraphic2.Free;
>
>
>>
>>Hi Brett,
>>
>>Have a look at the BackgroundColor, TransparentColor,
>>SaveTransparent, and SaveWithBackground properties in
>>the online help. You will need to set SaveTransparent
>>and TransparentColor before saving.
>>
>>The demo program does not specify a background color
>>so the background may be black when loading images.
>>
>>Best regards,
>>
>>Michel
>>
>>
>>>I am trying to convert a BMP to PNG and then set the
>>>background to be transparent so that it appears
>>>transparent in IE.
>>>
>>>Even when loading a transparent png from and then
>>>saving it immediately removes the transparency.
>>>
>>> gGraphic.LoadFromFile( 'c:\tbbn3p08[1].png' );
>>> gGraphic.Transparent := True;
>>> gGraphic.SaveToFile( 'c:\tbbn3p08[1]2.png' );
>>> fs := TFileStream.Create( 'c:\tbbn3p08[1]5.png',
>>>fmCreate );
>>> gGraphic.SaveToStream( fs );
>>>
>>>The demo application supplied with the library does
>>>not seem to load transparent PNGs, it fills in the
>>>background with black

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.