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

29
LINES

< > BotCompany Repo | #1010714 // Auto-segment current screen, allow comments [OK]

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (10762L/75K).

!7

p-subst {
  final RGBImage img = shootScreenBW().toRGB();
  final L<Rect> rects = autoSegment(img);
  final ImageSurface is = showImageWithSelections(img, rects);
  final Var<Rect> highlighted = showImageWithSelections_highlighted;
  is.specialPurposed = true;
  
  componentPopupMenu(is, voidfunc(JPopupMenu menu) {
    //Pt p = is.pointFromEvent(componentPopupMenu_mouseEvent!);
    Rect r = highlighted!;
    if (r != null) {
      final RGBImage clip = img.clip(r);
      fS md5 = rgbMD5(clip);
      addMenuItem(menu, "Comment... [MD5: " + md5 + "]", r {
        SS comments = thingsOnScreenDefinitions();
        final JTextField tf = jtextfield(comments.get(md5));
        showFormTitled("Comment image " + md5,
          "Image", new ImageChooser(clip),
          "Comment", tf,
          r {
            S text = getTextTrim(tf);
            addThingOnScreenDefinition(md5, text);
          });
        });
      }
  });
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010714
Snippet name: Auto-segment current screen, allow comments [OK]
Eternal ID of this version: #1010714/11
Text MD5: 892f3728bb9eb99b02a9d2c69ad76ed7
Transpilation MD5: 8246bf7b7eb4d35cd385d819123c691b
Author: stefan
Category: javax / ocr
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-10 20:32:06
Source code size: 963 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 596 / 1212
Version history: 10 change(s)
Referenced in: [show references]