Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

39
LINES

< > BotCompany Repo | #1018955 // Whole Screen Screenshot [shoot whole screen]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (7509L/40K).

1  
!7
2  
3  
cmodule WholeScreenScreenshot > DynImageSurface {
4  
  int delay = 3;
5  
  bool hideOS;
6  
  
7  
  visual
8  
    northAndCenterWithMargins(
9  
      jcenteredline(
10  
        jLabel("Delay:"),
11  
        jLiveValueSpinner(dm_fieldLiveValue('delay), 0, 10),
12  
        jlabel("s"),
13  
        jbutton("Shoot", rThread doIt),
14  
        dm_checkBox('hideOS, "Hide OS while shooting")),
15  
      super);
16  
17  
  enhanceFrame {
18  
    minimalFrameSize(f, 320, 240);
19  
  }
20  
  
21  
  void doIt enter {
22  
    temp hideOS ? dm_tempMinimizeOS() : null;
23  
    if (delay > 0) {
24  
      print("Sleeping " + delay + " s before taking screenshot...");
25  
      sleepSeconds(delay);
26  
    }
27  
    doItNow();
28  
  }
29  
  
30  
  // API
31  
  
32  
  BufferedImage doItNow() {
33  
    print("Shooting!");
34  
    BufferedImage img = shootScreen2();
35  
    infoBox("Screenshot made");
36  
    setImage(img);
37  
    ret img;
38  
  }
39  
}

Author comment

Began life as a copy of #1016386

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018955
Snippet name: Whole Screen Screenshot [shoot whole screen]
Eternal ID of this version: #1018955/15
Text MD5: 27bb0e13bc8094f9458f030d083c7da9
Transpilation MD5: 0feefdd94ede12b518803216e634b16b
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-11 15:41:54
Source code size: 851 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 387 / 13815
Version history: 14 change(s)
Referenced in: [show references]