Page 1 of 1

Resizing PNG with alpha channel

Posted: Mon Jun 18, 2012 12:00 am
by jirik2tg
Hi,

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)
    With ctrl
        .EnableLZW = true
        .LoadBitmap Path
        If .Width > .Height Then
            NewWidth = NewMaxDimension
            NewHeight = .Height/.Width * NewMaxDimension
        Else
            NewHeight = NewMaxDimension
            NewWidth = .Width/.Height * NewMaxDimension
        End If
        If NewWidth < .Width Then
            .Resize NewWidth, NewHeight
        End If
'         .UseTransparency = true
'         .SaveFormat = 3 'AX_PNG
        .SaveBitmap NewPath
    End With
    Set ctrl = nothing
End Function
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.

Jiri

Re: Resizing PNG with alpha channel

Posted: Mon Jun 18, 2012 4:30 am
by xnview
Do you have tried the v3?

Re: Resizing PNG with alpha channel

Posted: Mon Jun 25, 2012 5:36 am
by jirik2tg
xnview wrote:Do you have tried the v3?
Ok, v3 solves the problem.

Just btw, is there a x64 binary of gflax included? I couldn't find it, so I had to recompile.

Thanks for the help.

Jiri