Quick Demo stack for creating Transpanrecy effect.
jbv.silences at Club-Internet.fr
Thu May 5 06:05:04 CDT 2005
I was wrong : you can't set transparent pixels using the "replace"
function (actually I thought that the 1st byte of each pixel was used
for the alpha channel, but it's just zero).
But you can try the following script which uses the offset function.
With the image in your example, it's roughly 28 times faster :
set cursor to watch
put binaryEncode("C",0) into a
put a into b
repeat 3 times
put binaryEncode("C",255) after a
put imagedata of img 2 into IMD
put alphadata of img 2 into AD
put 0 into sk
put offset(a,IMD,sk) into c
if c=0 then
add c+3 to sk
put b into char sk/4 of AD
set alphadata of img 2 to AD
> one more question : have you tried to use the replace function for
> of 4 bytes in the imagedata to speed up things, instead of checking
> binary values
> in the imagedata and then setting each byte of the alphadata ?
> > Helping out a friend, I did this. It could be good for a number of
> > things including:
> > Creating cursors
> > Creating transparent GIFs
> > etc..
> > in the messagebox:
> > go URL "http://www.altuit.com/webs/altuit2/RunRev/altMakeTrans.rev"
> > altMakeTransparent
> > This is a small demo stack which has a neat function which can make a
> > specific color transparent in an image.
> > The demo makes all white pixels transparent. The function is in the
> > script of the button, "Make White Transparent"
> > -Chipp
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode