Libraryless. Click here for Pure Java version (4669L/31K/105K).
| 1 | !752 | 
| 2 | |
| 3 | static int grabWidth = 500, grabHeight = 300; | 
| 4 | |
| 5 | p {
 | 
| 6 |   while licensed {
 | 
| 7 |     pcall {
 | 
| 8 | Point from = mouseLocation(); | 
| 9 |       //print("yo " + from + " " + to);
 | 
| 10 | Rect r = intersectWithScreen(rectAround(new Pt(from), grabWidth, grabHeight)); | 
| 11 | BWImage img = shootScreenBW(r); | 
| 12 | L<Rect> rects = autoSegment(img, 3); | 
| 13 |       print("Grabbing " + r + ", got " + n(l(rects), "rect"));
 | 
| 14 | Rect found = firstRectContaining(rects, from.x-r.x, from.y-r.y); | 
| 15 |       if (found != null) {
 | 
| 16 | BWImage result = img.clip(found.getRectangle()); | 
| 17 | quickShowZoomedImage(result.getBufferedImage()); | 
| 18 | } else | 
| 19 |         print("Nope");
 | 
| 20 | } | 
| 21 | sleepSeconds(1); | 
| 22 | } | 
| 23 | } | 
Began life as a copy of #1006028
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1006031 | 
| Snippet name: | Auto-Shoot Area Around Mouse Pointer | 
| Eternal ID of this version: | #1006031/1 | 
| Text MD5: | c03c6c07ec4dcd86c012a86309999173 | 
| Transpilation MD5: | 05958315ede4419277d5433b558d3a3a | 
| Author: | stefan | 
| Category: | javax / gui | 
| Type: | JavaX source code | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2016-12-15 02:20:54 | 
| Source code size: | 695 bytes / 23 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 736 / 867 | 
| Referenced in: | [show references] |