Here's my code:
Code: Select all
<%
Const AX_PNG = 3
Set Pic = Server.CreateObject("GflAx.GflAx")
Pic.UseTransparency = True
Pic.LoadBitmap Server.MapPath("_trans.png")
Pic.FontName = "Verdana"
Pic.FontSize = 36
Pic.TextOut "This is a test", 0, 0, RGB(255,0,0)
Pic.SaveFormat = AX_PNG
Pic.SaveBitmap Server.MapPath("test.png")
Set Pic = Nothing
%>
<HTML><HEAD></HEAD><BODY>test.png saved...</BODY></HTML>
But first of all, creating a blank (transparent) image does not seem to be possible in the first place. I assumed the following would work:
Code: Select all
Set Pic = Server.CreateObject("GflAx.GflAx")
Pic.UseTransparency = True
Pic.NewBitmap 300, 200, &HFFFFFFFF
So I ended up loading a semi-transparent PNG instead, as in the example above ... this at least runs, but doesn't produce any useful result. For some reason, in the example above, the image produced has it's transparency mask inverted ... when I open the output file in Photoshop, everything is purple, the text which I set in red comes out transparent, and the rest of the transparency mask seems to have been completely mangled...
download a zipped copy of the code and images here...
Open the two images in photoshop to see the difference ... (my script does not output an IMG tag, because semitransparent PNG is not supported in Internet Explorer).