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

19
LINES

< > BotCompany Repo | #1009023 // Upload PNG webcam image to Stefan's Chat [WORKS, but PNG is too big]

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

Uses 2596K of libraries. Click here for Pure Java version (4305L/29K/111K).

1  
!7
2  
3  
p {
4  
  BufferedImage img = cast time(f singleImageFromLastWebcam);
5  
  ImageSurface is = showImage("Will upload in 3! Close window to stop this.", img);
6  
  sleepSeconds(3);
7  
  if (!is.isShowing()) {
8  
    print("Upload cancelled.");
9  
    ret;
10  
  }
11  
  setFrameTitle(is, "Uploading...");
12  
  S imageURL = uploadToImageServer(img, "User webcam image");
13  
  print("Image uploaded as " + imageURL);
14  
  setFrameTitle(is, "Posting...");
15  
  if (postToStefansChat("[IMAGE] " + imageURL))
16  
    setFrameTitle(is, print("Posted image to chat!"));
17  
  else
18  
    setFrameTitle(is, print("Could not post image."));
19  
}

Author comment

Began life as a copy of #1009018

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: #1009023
Snippet name: Upload PNG webcam image to Stefan's Chat [WORKS, but PNG is too big]
Eternal ID of this version: #1009023/7
Text MD5: 3fb5bc55bfb051ab4ec9b14488a1abe8
Transpilation MD5: 4a37477155b24488ddd905ace0ca6e8b
Author: stefan
Category: javax / desktop / camera
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-28 19:44:46
Source code size: 603 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 495 / 580
Version history: 6 change(s)
Referenced in: [show references]