Enable alpha channel if available

Discuss any general programming issues here
Post Reply
Mazze
Posts: 61
Joined: Thu May 06, 2010 8:08 pm

Enable alpha channel if available

Post by Mazze » Mon May 16, 2016 2:09 pm

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?

PEB
Posts: 210
Joined: Sun Feb 21, 2010 1:28 am

Re: Enable alpha channel if available

Post by PEB » Tue May 17, 2016 4:27 am

Before using LoadBrush() you could use IsPicture() and check the Alpha field in the returned table.

Mazze
Posts: 61
Joined: Thu May 06, 2010 8:08 pm

Re: Enable alpha channel if available

Post by Mazze » Tue May 17, 2016 6:36 am

Thanks.

Post Reply