Page 1 of 1

ASP comp. PNG & Transparency

Posted: Sun Jul 10, 2005 4:32 pm
by webdev
Hi,

been looking for a long time for a good asp component that handles png & transparency..

that one seems to do so but i can't get it to work properly, don't know if i'm doing something wrong it should be quite simple from what i've seen..

what would be the proper code to load a png file and save it back keeping its transparency ?

for my test i simply use the example4.asp test and modify a couple of things..

Code: Select all

const AX_PNG = 3

With ctrl
  .UseTransparency =  True
  .LoadBitmap Path & "\test.png"
  .SaveFormat = AX_PNG 'Save in PNG format
  .SavePNGCompression = 7
  .SaveBitmap Path & "\output.png"
end with
set ctrl=nothing
i've tried with some png-24 files of my own and so other found on the web, like that one for example :

Image

sometimes i get some black background like with the file above or white wackgrounf with my png files.. i don't use any gradients in my pngs so i guess it's why it gets all white, not like the file above..

thx for your help

.webdev

PS:
1.your examples use AX_JPEG=3 which is not correct according to your help documentation, AX_JPEG should be 1 not 3 (=AX_PNG)
2.I'm using firefox for my tests as i know msie has serious problems with png transparency.. i've also checked the output files with photoshop..[/code]

Posted: Mon Jul 11, 2005 3:39 pm
by webdev
if it makes any difference, i run my tests from a windows 2003 server

Posted: Tue Jul 12, 2005 12:44 pm
by webdev
one other quick strange thing i've noticed..

when setting
.UseTransparency = True

reading it back, returns the value "-1"

then i can set .UseTransparency = 1, instead of true and reading the value returns 1

but now if i set .UseTransparency = 10 or any other value it doesn't return any error and keeps that value..

Posted: Wed Jul 13, 2005 11:46 am
by xnview
webdev wrote:if it makes any difference, i run my tests from a windows 2003 server
Yes, currently a little problem, alpha is removed when file is loaded.

Posted: Tue Aug 09, 2005 11:38 am
by lazerfisk
Also keep in mind that only firefox (and maybe opera) can handle PNG transparency, so no matter how much you try to throw a valid PNG with transparency at IE it won't work. You will have to try something else in order to get this working there :)

Cheers,
Christopher