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).

!7

cmodule WholeScreenScreenshot > DynImageSurface {
  int delay = 3;
  bool hideOS;
  
  visual
    northAndCenterWithMargins(
      jcenteredline(
        jLabel("Delay:"),
        jLiveValueSpinner(dm_fieldLiveValue('delay), 0, 10),
        jlabel("s"),
        jbutton("Shoot", rThread doIt),
        dm_checkBox('hideOS, "Hide OS while shooting")),
      super);

  enhanceFrame {
    minimalFrameSize(f, 320, 240);
  }
  
  void doIt enter {
    temp hideOS ? dm_tempMinimizeOS() : null;
    if (delay > 0) {
      print("Sleeping " + delay + " s before taking screenshot...");
      sleepSeconds(delay);
    }
    doItNow();
  }
  
  // API
  
  BufferedImage doItNow() {
    print("Shooting!");
    BufferedImage img = shootScreen2();
    infoBox("Screenshot made");
    setImage(img);
    ret img;
  }
}

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: 309 / 13701
Version history: 14 change(s)
Referenced in: [show references]