[REBOL] What am I doing wrong?
From: philb:upnaway at: 10-Mar-2002 23:09
Hi Porter,
Was there a reson why were you using the crop effect?
You could use the offset of the face .... below is an update to your program to demonstrate
(I changed the gif to a png, but you could change it back).
rebol []
imagefile: %bigsky.png ;a 320x200 png
imagedata: to-image load imagefile
imageoffs: 0x0
imagesize: 160x100
mylayout: layout [
at 0x0
imagedisp: image imagedata rate 30 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"]
imagedisp/offset: - imageoffs
show imagedisp
]
]
view mylayout
Cheers Phil
=== Original Message ===
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