-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (30 loc) · 768 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (30 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <QApplication>
#include <iostream>
#include <slop.hpp>
#include "XRapture.hpp"
int main(int argc, char** argv)
{
slop::SlopSelection selection(0, 0, 0, 0, 0, true);
slop::SlopOptions options;
options.border = 2.0;
options.tolerance = 0.0;
if(argc == 1) {
selection = slop::SlopSelect(&options);
if(selection.cancelled) {
std::cerr << "cancelled" << std::endl;
return 1;
}
}
QApplication app(argc, argv);
QGraphicsScene scene;
XRapture* xrapture = new XRapture(&scene);
if(argc > 1) {
xrapture -> show();
if(!xrapture -> openImageFile(argv[1])) return 1;
}
else {
xrapture -> screenCapture(selection.x, selection.y, selection.w, selection.h);
xrapture -> show();
}
return app.exec();
}