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

[REBOL] Drawing on images

From: atruter::hih::com::au at: 11-Jul-2002 18:20

I'm looking at ways of speeding up drawing on images. Given the code below, and the differences in speed between 300x200 and 640x480, are there any better ways of doing this. <CODE> REBOL [] stylize/master: [ draw-image: image with [ line?: false feel: make feel [ engage: func [face action event] [ if action = 'down [ face/line?: true insert tail cmd compose [line (event/offset)] ] if action = 'up [face/line?: false] if all [event/type = 'move face/line?] [ insert tail cmd compose [(event/offset)] show face ] ] ] ] ] save/png %test.png to-image 300x200 ;save/png %test.png to-image 640x480 cmd: copy [pen red] view layout [ origin 0 space 0 across draw-color: choice "red" "green" "blue" [ insert tail cmd compose [pen (get to-word draw-color/text)] ] btn "Undo" [ if (length? cmd) > 2 [ while [(type? last cmd) = pair!] [remove back tail cmd] while [all [(type? last cmd) <> pair! (length? cmd) > 2]] [remove back tail cmd] show img ] ] return img: draw-image %test.png effect compose/deep/only [draw (cmd)] ] </CODE> Regards, Ashley