Page 1 of 1

Enable alpha channel if available

Posted: Mon May 16, 2016 2:09 pm
by Mazze
Hi,

with Hollywood 5.3 I want to load a brush such that the alpha channel is enabled if available.

Code: Select all

LoadBrush(2, self.picture, {LoadAlpha=True})
gives an error for e.g. a JPEG file.

Code: Select all

        LoadBrush(2, self.picture)
        If GetAttribute(#BRUSH, 2, #ATTRHASALPHA)
            DebugPrint("!!!!alpha*****")
            ChangeBrushTransparency(2, #ALPHACHANNEL)
        EndIf
doesn't work (GetAttribute never returns TRUE). Is there a possibility?

Re: Enable alpha channel if available

Posted: Tue May 17, 2016 4:27 am
by PEB
Before using LoadBrush() you could use IsPicture() and check the Alpha field in the returned table.

Re: Enable alpha channel if available

Posted: Tue May 17, 2016 6:36 am
by Mazze
Thanks.