1 | static float darkenScreenArea_factor = 0.5f; |
2 | |
3 | static JWindow darkenScreenArea(Rectangle r, double seconds) { |
4 | ret disposeWindowAfter(iround(seconds*1000), |
5 | darkenScreenArea(r)); |
6 | } |
7 | |
8 | static JWindow darkenScreenArea(final Rectangle r) { |
9 | ret (JWindow) swingAndWait(func { |
10 | Rectangle r2 = maxWindowBounds().intersection(r); |
11 | if (neq(r, r2)) warn("darkenScreenArea: Rectangle cropped"); |
12 | if (r2.isEmpty()) null; |
13 | |
14 | BufferedImage img = shootScreen2(r2); |
15 | RescaleOp op = new RescaleOp(darkenScreenArea_factor, 0, null); |
16 | img = op.filter(img, null); |
17 | |
18 | JLabel label = new JLabel(imageIcon(img)); |
19 | new JWindow w; |
20 | w.setBounds(r2); |
21 | w.add(label); |
22 | w.setAlwaysOnTop(true); |
23 | w.setVisible(true); |
24 | ret w; |
25 | }); |
26 | } |
Began life as a copy of #1005626
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005675 |
Snippet name: | darkenScreenArea |
Eternal ID of this version: | #1005675/1 |
Text MD5: | f8c7a6860a7dcc8d35e6da116fdb4bbe |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-02 20:23:32 |
Source code size: | 773 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 587 / 586 |
Referenced in: | [show references] |