This was already discussed here however without any result. Is resizing of PNG image with alpha channel supported? When I try to do it with GFLAx (ActiveX/ASP component) light v2.80, I just get a black background in the resized image.
This is the code I am using:
- Code: Select all
Function ResizeImage(Path, NewPath, NewMaxDimension)
Set ctrl = Server.CreateObject(ImageComponent)
.EnableLZW = true
If .Width > .Height Then
NewWidth = NewMaxDimension
NewHeight = .Height/.Width * NewMaxDimension
NewHeight = NewMaxDimension
NewWidth = .Width/.Height * NewMaxDimension
If NewWidth < .Width Then
.Resize NewWidth, NewHeight
' .UseTransparency = true
' .SaveFormat = 3 'AX_PNG
Set ctrl = nothing
Note that uncommenting the commented code does not help. I am attaching a sample picture with that behavior and the resized result.
Thanks for any ideas.