REBOL[Title:""] WIN_WIDTH: 200 WIN_HEIGHT: 200 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" view/options win: layout/offset/size [ key #"^q" [free mylib quit] key #"^s" [createscreenshot "desktop.png"] key #"^z" [ if exists? %spot.png [delete %spot.png] x: getmousepos 0 y: getmousepos 1 startx: x - (WIN_WIDTH / 4) starty: y - (WIN_HEIGHT / 4) x: x - (WIN_WIDTH / 2) y: y - (WIN_HEIGHT / 2) backshot "spot.png" startx starty (WIN_WIDTH / 2) (WIN_HEIGHT / 2) while [not exists? %spot.png][wait 1] img/image: load %spot.png win/offset: to-pair reduce[to-integer x to-integer y] show img show win ] 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]