1 | static new ThreadLocal<Double> screenLens_sleep; |
2 | static new ThreadLocal<Int> screenLens_w; |
3 | static new ThreadLocal<Int> screenLens_h; |
4 | |
5 | static ImageSurface screenLens() { |
6 | final double sleep = optParam(screenLens_sleep, 0.2); |
7 | final int w = optParam(screenLens_w, 300); |
8 | final int h = optParam(screenLens_h, 300); |
9 | ret (ImageSurface) swingAndWait(func { |
10 | final ImageSurface is = alwaysOnTop(showImage(new RGBImage(w, h, Color.white; |
11 | hideConsole(; |
12 | installTimer(is, toMS(sleep), r { |
13 | Rect r = intersectWithScreen(rectAround(new Pt(mouseLocation()), w, h)); |
14 | BufferedImage img = shootScreen2(r); |
15 | is.setImage(img); |
16 | }); |
17 | }); |
18 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006525 |
Snippet name: | screenLens - show screen lens - better use class ScreenLens instead |
Eternal ID of this version: | #1006525/1 |
Text MD5: | d02ffe894f030a2c4104c1762d834415 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-01-14 19:07:18 |
Source code size: | 672 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 486 / 499 |
Referenced in: | [show references] |