Enable alpha channel if available

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

Enable alpha channel if available

Post 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?
PEB
Posts: 569
Joined: Sun Feb 21, 2010 1:28 am

Re: Enable alpha channel if available

Post by PEB »

Before using LoadBrush() you could use IsPicture() and check the Alpha field in the returned table.
Mazze
Posts: 69
Joined: Thu May 06, 2010 8:08 pm

Re: Enable alpha channel if available

Post by Mazze »

Thanks.
Post Reply