Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: draw question

From: cyphre:seznam:cz at: 25-Oct-2002 13:59

Hello Bruno and all, I'm not sure if I understand you well but here is a simple example how to use DRAW dialect for "painting" into alpha channel of the image. I think with the function make-alpha (bellow in the example) you can draw almost any kind of transparent shape though it is not the fastest method....IMO the possibility to use DRAW pens for alpha channel should be done at Rebol's native level...What dou you think Holger? ;-) !!watch out line breaks!! --------------<code>------------- make-alpha: func [fx img /local idx][ append fx 'grayscale fx: to-block mold to-image make face [ size: img/size effect: fx edge: none ] fx: fx/3/2 img: to-block mold img idx: 0 remove-each i fx [ idx: idx + 1 either idx > 1 [ if idx = 3 [idx: 0] true ][ false ] ] append img/3 fx return do load img ] pic: load-thru/binary http://www.rebol.cz/~cyphre/bay.jpg view layout [ backdrop effect reduce ['gradient red orange] image make-alpha [ gradient 1x1 0.0.0 255.255.255 draw [ pen 0.0.0 fill-pen 200.200.200 circle 100x80 50 fill-pen 0.0.0 box 80x80 125x125 ] ] pic ] -----------------------------<end of code>------------------------------- regards, Cyphre