Re: does this PNG have transparency?

2020-01-27 Thread Phil Davis via use-livecode

I like it! Nice job.

Phil


On 1/27/20 8:21 AM, Bob Sneidar via use-livecode wrote:

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 
 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


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



--
Phil Davis
503-307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: does this PNG have transparency?

2020-01-27 Thread Bob Sneidar via use-livecode
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 
>  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


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: does this PNG have transparency?

2020-01-27 Thread Paul Dupuis via use-livecode
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




On 1/27/2020 10:53 AM, Bob Sneidar via use-livecode wrote:

Phil,

Is img "my test" an existing image, or does setting the filename of img "my 
test" create the image on the fly? I'm trying to turn this into a function that returns true 
or false.

Bob S



On Jan 24, 2020, at 14:35 , Phil Davis via use-livecode 
 wrote:

Maybe this? It seems to work in my simple testing. Am I missing something?

on mouseUp
 answer file "Pick an image:"
 if it is empty then exit to top
 set the filename of img "my test" to it

 put numtochar(0) into tZero
 put (tZero is in the alphaData of img "my test") OR (tZero is in the maskData of img 
"my test")
end mouseUp

Phil


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: does this PNG have transparency?

2020-01-27 Thread Bob Sneidar via use-livecode
Phil, 

Is img "my test" an existing image, or does setting the filename of img "my 
test" create the image on the fly? I'm trying to turn this into a function that 
returns true or false. 

Bob S


> On Jan 24, 2020, at 14:35 , Phil Davis via use-livecode 
>  wrote:
> 
> Maybe this? It seems to work in my simple testing. Am I missing something?
> 
> on mouseUp
> answer file "Pick an image:"
> if it is empty then exit to top
> set the filename of img "my test" to it
> 
> put numtochar(0) into tZero
> put (tZero is in the alphaData of img "my test") OR (tZero is in the 
> maskData of img "my test")
> end mouseUp
> 
> Phil


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: does this PNG have transparency?

2020-01-25 Thread J. Landman Gay via use-livecode

I think that's pretty clever.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On January 24, 2020 4:37:20 PM Phil Davis via use-livecode 
 wrote:



Maybe this? It seems to work in my simple testing. Am I missing something?

on mouseUp
answer file "Pick an image:"
if it is empty then exit to top
set the filename of img "my test" to it

put numtochar(0) into tZero
put (tZero is in the alphaData of img "my test") OR (tZero is in
the maskData of img "my test")
end mouseUp

Phil


On 1/24/20 1:48 PM, Phil Davis via use-livecode wrote:

I usually make things harder than they need to be, so I'm asking: Is
there a simple way my LC code can determine if a PNG image is
completely opaque or not?

Thanks -
Phil



--
Phil Davis
503-307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: does this PNG have transparency?

2020-01-24 Thread Phil Davis via use-livecode

Maybe this? It seems to work in my simple testing. Am I missing something?

on mouseUp
    answer file "Pick an image:"
    if it is empty then exit to top
    set the filename of img "my test" to it

    put numtochar(0) into tZero
    put (tZero is in the alphaData of img "my test") OR (tZero is in 
the maskData of img "my test")

end mouseUp

Phil


On 1/24/20 1:48 PM, Phil Davis via use-livecode wrote:
I usually make things harder than they need to be, so I'm asking: Is 
there a simple way my LC code can determine if a PNG image is 
completely opaque or not?


Thanks -
Phil



--
Phil Davis
503-307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


does this PNG have transparency?

2020-01-24 Thread Phil Davis via use-livecode
I usually make things harder than they need to be, so I'm asking: Is 
there a simple way my LC code can determine if a PNG image is completely 
opaque or not?


Thanks -
Phil

--
Phil Davis
503-307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode