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

29
LINES

< > BotCompany Repo | #1010735 // JavaX Live WebCam - Show live webcam image in frame v3 [with bot & live-saving]

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

Download Jar. Uses 6469K of libraries. Click here for Pure Java version (7193L/49K).

1  
!7
2  
3  
static WebcamPanel panel;
4  
static double saveEvery = 10.0;
5  
static volatile File latestSaved;
6  
7  
p-substance-noconsole {
8  
  panel = new WebcamPanel(openWebCam(), true);
9  
  panel.setFPSDisplayed(true);
10  
  frameIcon(#1009177, exitProgramOnFrameClose(alwaysOnTop(showPackedFrame("JavaX Live WebCam", panel)));
11  
  bot("WebCam.");
12  
  doEvery_daemon_now(saveEvery, f saveDefault);
13  
}
14  
15  
answer {
16  
  if "save jpeg at *" {
17  
    saveJPEG(newFile($1), imageFromWebcamPanel(panel));
18  
    ret "OK";
19  
  }
20  
  if "latest file"
21  
    ret latestSaved == null ? "Not saved yet"
22  
      : "OK " + quote(f2s(latestSaved));
23  
}
24  
25  
svoid saveDefault {
26  
  File file = getProgramFile("live-" + dateWithSecondsForFile() + ".jpg");
27  
  saveJPEG(file, imageFromWebcamPanel(panel));
28  
  latestSaved = file;
29  
}

Author comment

Began life as a copy of #1009113

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: #1010735
Snippet name: JavaX Live WebCam - Show live webcam image in frame v3 [with bot & live-saving]
Eternal ID of this version: #1010735/11
Text MD5: f9b54c6773389f1c66a376f3bc66a528
Transpilation MD5: 08f8fe26fa3a561e24bd281c7cb09adb
Author: stefan
Category: javax / desktop / camera
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-30 20:30:32
Source code size: 782 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 626 / 1566
Version history: 10 change(s)
Referenced in: [show references]