[REBOL] What am I doing wrong?
From: pwoodward:cncdsl at: 9-Mar-2002 19:24
OK -
all I want to do is load an image, and be able to pan around on it... I
figured I could do this using the crop effect to make a "viewport" to the
image. Unfortunately I seem to be braindead, and cannot seem to make this
work out. Here's a rough script I've been fiddling with:
rebol []
imagefile: %test.gif ;a 320x200 gif
imagedata: to-image load imagefile
imageoffs: 0x0
imagesize: 160x100
mylayout: layout [
at 0x0
imagedisp: image imagedata rate 15 size 160x100
]
imagedisp/feel: make imagedisp/feel [
engage: func [f a e] [
either imageoffs/x < 100 [
imageoffs/x: imageoffs/x + 1
][
imageoffs/x: 0
print "back to zero"
]
f/effect: [crop imageoffs imagesize]
hide/show [imagedisp]
show f
]
]
view mylayout
What am I doing wrong?
- Porter Woodward