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

26
LINES

< > BotCompany Repo | #1006531 // Screen Lens With Demo Analyzers

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

Libraryless. Click here for Pure Java version (6394L/44K/151K).

!7

static ScreenLens lens;
static JTextArea taResult;
static new SingleThread singleThread;
static long time;

p-substance {
  lens = new ScreenLens().start();
  taResult = jTextArea();
  addToWindow(lens.is, withTopMargin(jMinHeight(100, wrap(taResult))));
  lens.onImageChange = r {
    //if (time != 0) print((sysNow()-time) + " ms");
    //time = sysNow();
    singleThread.run(r {
      setText(taResult, analyze(lens.is.getImage()))
    });
  };
}

static S analyze(BufferedImage img) {
  //RGBImage rgb = new RGBImage(img);
  BWImage bw = new BWImage(img);
  ret "Color at pointer: " + colorAtMousePointer()
    + "\nBrightness: " + bw.averageBrightness();
}

Author comment

Began life as a copy of #1006527

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: #1006531
Snippet name: Screen Lens With Demo Analyzers
Eternal ID of this version: #1006531/1
Text MD5: 17b44379c4df7d3fc2f0b7f375ae364b
Transpilation MD5: 62e74ac170e6901038b1336a9db6de0a
Author: stefan
Category: javax / gui / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-15 16:12:36
Source code size: 691 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 526 / 605
Referenced in: [show references]