Warning: session_start(): open(/var/lib/php/sessions/sess_e27a0flnqml5g8tri23b5sd3h9, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
static ImageSurface imageSurface;
static JButton btnUpload;
static JFrame frame;
static JLabel lStatus;
concept Title {
S title;
}
p {
concepts();
final BufferedImage img = shootScreen2();
awt {
ImageSurface.verbose = true;
imageSurface = new ImageSurface(img) {
public void setSelection(Rectangle r) {
super.setSelection(r);
btnUpload.setText(r != null ? "Upload (selected area)" : "Upload");
lStatus.setText(r == null ? "" : str(new Rect(r)));
}
};
JPanel buttons = jcenteredline(
lStatus = jlabel(),
btnUpload = jbutton("Upload", r {
String title = or2(uniq(Title).title, "A screenshot");
title = JOptionPane.showInputDialog(null, "Please enter screenshot title", title);
if (title == null) return;
BufferedImage image = imageSurface.getImage();
if (imageSurface.getSelection() != null)
image = new RGBImage(image).clip(imageSurface.getSelection()).getBufferedImage();
cset(uniq(Title), +title);
S url = uploadJPEGToImageServer(image, title);
popup("Image uploaded: " + url);
}),
jbutton("Shoot again", r {
hideFrame(frame);
swingLater(1000, r {
imageSurface.setImage(shootScreen2());
makeFrameVisible(imageSurface);
maximizeFrame(imageSurface);
});
})
);
frame = showMaximizedFrame(centerAndSouth(
new JScrollPane(imageSurface), buttons));
if (amFirstProgram()) hideConsole();
}
}