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

25
LINES

< > BotCompany Repo | #1005662 // Let user mark an area on the screen (in zoomed ImageSurface) [WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (3329L/23K/83K).

1  
!752
2  
3  
p {
4  
  final JWindow window = showAnimationInTopRightCorner("#1005611", "Please click in the area you would like to select");
5  
  
6  
  // TODO: onClosing(window, "trackOneClick_cancel");
7  
  
8  
  trackOneClick(voidfunc(Point p) {
9  
    window.dispose();
10  
    
11  
    final ImageSurface is = imageSurface(shootScreen2());
12  
    is.setZoom(4);
13  
    JFrame frame = showCenterFrame("Please select area", jScrollPane(is));
14  
    setFrameBounds(frame, centerScreenPart(0.75));
15  
    addToWindow(frame, imageSelectionDepend(is, jbutton("OK", r {
16  
      Rectangle r = is.selection;
17  
      if (r != null) {
18  
        disposeWindow(is);
19  
        showAnimation("#1005611", "You marked " + r, 3);
20  
        pointArrowsToArea(r, 5);
21  
      }
22  
    })));
23  
    is.centerPoint(p);
24  
  });
25  
}

Author comment

Began life as a copy of #1005630

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: #1005662
Snippet name: Let user mark an area on the screen (in zoomed ImageSurface) [WORKS]
Eternal ID of this version: #1005662/1
Text MD5: c9276b0f2fbaf473415df72709fc498d
Transpilation MD5: f02d3859195f1f32b50e47c7f4166859
Author: stefan
Category: javax / gui / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-02 16:07:49
Source code size: 769 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 536 / 628
Referenced in: [show references]