ASP comp. PNG & Transparency

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

Moderators: XnTriq, helmut, xnview

webdev
Posts: 3
Joined: Sun Jul 10, 2005 4:18 pm

ASP comp. PNG & Transparency

Post 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]
webdev
Posts: 3
Joined: Sun Jul 10, 2005 4:18 pm

Post by webdev »

if it makes any difference, i run my tests from a windows 2003 server
webdev
Posts: 3
Joined: Sun Jul 10, 2005 4:18 pm

Post 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..
User avatar
xnview
Author of XnView
Posts: 43163
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post 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.
Pierre.
lazerfisk
Posts: 17
Joined: Wed May 05, 2004 3:00 pm
Location: Karlstad, Sweden

Post 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