Convert transparent PNG on import?

Mike Bonner bonnmike at gmail.com
Tue Feb 3 11:26:44 EST 2015


Using an opaque graphic, with the blendlevel set to 100 works fine, or so
it seems.

On Tue, Feb 3, 2015 at 3:33 AM, Richmond <richmondmathewson at gmail.com>
wrote:

> On 03/02/15 10:37, BNig wrote:
>
>> Hi Marty,
>>
>> would it help if the transparent parts where just a little
>> non-transparent?
>> hardly noticeble
>>
>> You would set all 0 to 1 in alphaData, the rest is unchanged.
>>
>> -------------------------------------------
>> on mouseUp
>>     put the alphaData of image 1 into tAlpha
>>     put numToByte(0) into tNull
>>     put numToByte(1) into tOne
>>     repeat for each byte anAlpha in tAlpha
>>        if anAlpha = tNull then
>>           put tOne after tCollect
>>        else
>>           put anAlpha after tCollect
>>        end if
>>     end repeat
>>     set the alphaData of image 1 to tCollect
>> end mouseUp
>> ---------------------------------------------
>>
>> this is fairly fast, works also in 7.x.x
>>
>> Once you change 0 to 1 in alphaData the translucent parts of the png
>> receive
>> mouseClicks etc. You must be aware of that.
>>
>> Kind regards
>> Bernd
>>
>>
>>
> This idea seems very good indeed: the fact that the areas set at 1 in
> alphaData will recieve
> mouseClicks is no worse than my suggestion about layering with an opaque
> graphic, but those
> transparent areas will still appear transparent to the end-user, while
> with my suggestion
> they would have ended up as white.
>
> Richmond.
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list