REBOL[Title:""] WIN_WIDTH: 200 WIN_HEIGHT: 200 OFFSET_Y: 60 OFFSET_X: 60 WAIT_HIDE: .2 mylib: load/library %GraphicLib.dll createscreenshot: make routine! ["The CreateScreenshot function returns an int." name [string!] "[in] name of output file." return: [integer!] "The return value is an integer" ] mylib "CreateScreenshot" backshot: make routine! [ "The backshot function returns an int." name [string!] "[in] name of output file." x [integer!] "[in] x." y [integer!] "[in] y." width [integer!] "[in] width of window." height [integer!] "[in] height of window." return: [integer!] "The return value is an integer" ] mylib "Backshot" getmousepos: make routine! [ "The getmousepos function returns an int." coor [integer!] "[in] x or y 0=x." ;return: [struct! [x [integer!] y [integer!]]] "The return value is a struct" return: [integer!] ] mylib "GetMousePos" ;needs a way to zoom in past 2x(don't unview) UpdateZoom: func["Updates the form" x [Integer!] y [Integer!] "filename" /local startx starty] [ if exists? %spot.png [delete %spot.png] unview win startx: x - (WIN_WIDTH / 4) starty: y - (WIN_HEIGHT / 4) x: x - (WIN_WIDTH / 2) y: y - (WIN_HEIGHT / 2) wait WAIT_HIDE backshot "spot.png" startx starty (WIN_WIDTH / 2) (WIN_HEIGHT / 2) while [not exists? %spot.png][wait WAIT_HIDE] img/image: load %spot.png win/offset: to-pair reduce[to-integer x to-integer y] show img show win view win ] view/options win: layout/offset/size [ key #"^q" [free mylib quit] key #"^y" [createscreenshot "desktop.png"] key #"^z" [ tx: getmousepos 0 ty: getmousepos 1 UpdateZoom tx ty ] key #"^w" [ UpdateZoom (win/offset/x + (WIN_WIDTH / 2)) (win/offset/y + OFFSET_Y) ] key #"^s" [ UpdateZoom (win/offset/x + (WIN_WIDTH / 2)) (win/offset/y - OFFSET_Y + (WIN_HEIGHT)) ] key #"^a" [ UpdateZoom (win/offset/x + OFFSET_X) (win/offset/y + (WIN_HEIGHT / 2)) ] key #"^d" [ UpdateZoom (win/offset/x - OFFSET_X + (WIN_WIDTH)) (win/offset/y + (WIN_HEIGHT / 2)) ] origin 0 img: image to-pair reduce[to-integer WIN_WIDTH to-integer WIN_HEIGHT] effect[aspect] ] 30x30 to-pair reduce[to-integer WIN_WIDTH to-integer WIN_HEIGHT] [no-title no-border]