does this PNG have transparency?

Bob Sneidar bobsneidar at iotecdigital.com
Mon Jan 27 11:21:24 EST 2020


Voila! 

function pngIsTransparent pImageFile
   if not (there is a file pImageFile) then return "ERROR: Invalid file path!"
   set the filename of the templateImage to pImageFile
   put numtochar(0) into tZero
   return (tZero is in the alphaData of the templateImage) OR (tZero is in the maskData of the templateImage)
end pngIsTransparent

Another one for the masterLibrary

Bob S


> On Jan 27, 2020, at 08:16 , Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> You should be able to use 'the templateImage' (see dictionary), and numToChar probably should be numToByte
> 
> As in:
> 
> on mouseUp
>    answer file "Pick an image:"
>    if it is empty then exit to top
>    set the filename of the templateImage to it
> 
>    put numToByte(0) into tZero
>    put (tZero is in the alphaData of the templateImage) OR (tZero is in the maskData of the templateImage)
> end mouseUp





More information about the use-livecode mailing list