diff --git a/IPL/IPL.pro b/IPL/IPL.pro
index 0a656ba..d0b6afc 100644
--- a/IPL/IPL.pro
+++ b/IPL/IPL.pro
@@ -17,7 +17,8 @@
#
##############################################################################
-CONFIG -= qt
+# CONFIG -= qt
+QT += core gui
TARGET = IPL
CONFIG(debug, debug|release): DESTDIR = ../ImagePlay/debug
diff --git a/IPL/include/IPL_processes.h b/IPL/include/IPL_processes.h
index a42091e..666e1f7 100644
--- a/IPL/include/IPL_processes.h
+++ b/IPL/include/IPL_processes.h
@@ -27,6 +27,7 @@
//#include "IPLLoadVideo.h"
#include "IPLCamera.h"
#include "IPLLoadImageSequence.h"
+#include "IPLScreenshot.h"
#include "IPLSynthesize.h"
#include "IPLSaveImage.h"
#include "IPLBinarize.h"
diff --git a/IPL/include/processes/IPLScreenshot.h b/IPL/include/processes/IPLScreenshot.h
new file mode 100644
index 0000000..489e9c2
--- /dev/null
+++ b/IPL/include/processes/IPLScreenshot.h
@@ -0,0 +1,61 @@
+//#############################################################################
+//
+// This file is part of ImagePlay.
+//
+// ImagePlay is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ImagePlay is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with ImagePlay. If not, see .
+//
+//#############################################################################
+
+#ifndef IPLSCREENSHOT_H
+#define IPLSCREENSHOT_H
+
+#include
+#include
+#include
+#include
+#include
+
+#include "IPL_global.h"
+#include "IPLProcess.h"
+
+#include "opencv2/core/core.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui.hpp"
+
+/**
+ * @brief The IPLScreenshot class
+ */
+class IPLSHARED_EXPORT IPLScreenshot : public IPLClonableProcess
+{
+ public:
+ IPLScreenshot() : IPLClonableProcess() { init(); }
+ ~IPLScreenshot() { destroy(); }
+
+ void init();
+ void destroy();
+ virtual bool processInputData (IPLData* data, int inNr, bool useOpenCV);
+ virtual IPLImage* getResultData (int outNr);
+ virtual void afterProcessing ();
+
+ protected:
+ IPLImage* _result;
+ bool _continuous;
+
+ int _winId;
+ QPixmap _pixmap;
+ QImage _qimage;
+ cv::Mat _mat;
+};
+
+#endif // IPLSCREENSHOT_H
diff --git a/IPL/src/processes/IPLScreenshot.cpp b/IPL/src/processes/IPLScreenshot.cpp
new file mode 100644
index 0000000..d6afcdf
--- /dev/null
+++ b/IPL/src/processes/IPLScreenshot.cpp
@@ -0,0 +1,94 @@
+//#############################################################################
+//
+// This file is part of ImagePlay.
+//
+// ImagePlay is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ImagePlay is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with ImagePlay. If not, see .
+//
+//#############################################################################
+
+#include "IPLScreenshot.h"
+
+void IPLScreenshot::init()
+{
+ // init
+ _result = NULL;
+ _winId = 0;
+
+ // basic settings
+ setClassName("IPLScreenshot");
+ setTitle("Load from another running window/desktop");
+ setCategory(IPLProcess::CATEGORY_IO);
+ setIsSource(true);
+
+ // inputs and outputs
+ addOutput("Image", IPL_IMAGE_COLOR);
+
+ addProcessPropertyUnsignedInt("trigger", "Trigger Image", "", 0, IPL_WIDGET_BUTTON);
+ addProcessPropertyBool("continuous", "Run continuously", "", false, IPL_WIDGET_CHECKBOXES);
+ // addProcessPropertyInt("wid", "Window Selector", "", ...);
+}
+
+void IPLScreenshot::destroy()
+{
+ delete _result;
+}
+
+bool IPLScreenshot::processInputData(IPLData*, int, bool)
+{
+ // delete previous result
+ delete _result;
+ _result = NULL;
+ _continuous = getProcessPropertyBool("continuous");
+
+ notifyProgressEventHandler(-1);
+
+ // if (const QWindow *window = windowHandle())
+ // screen = window->screen();
+ QScreen *screen = QGuiApplication::primaryScreen();
+ // QDesktopWidget* dw = QApplication::desktop();
+ if (!screen)
+ return NULL;
+ _pixmap = screen->grabWindow(0);
+
+ _qimage = _pixmap.toImage();
+ _mat = cv::Mat(_qimage.height(), _qimage.width(), CV_8UC4, (uchar*)_qimage.bits(), _qimage.bytesPerLine());
+ _result = new IPLImage(_mat);
+
+ if(!_result)
+ {
+ addError("Could not fetch screenshot.");
+ return false;
+ }
+
+ /*
+ std::stringstream s;
+ s << "Foo ";
+ addInformation(s.str());
+ */
+
+ return true;
+}
+
+IPLImage *IPLScreenshot::getResultData(int)
+{
+ return _result;
+}
+
+void IPLScreenshot::afterProcessing()
+{
+ if(_continuous)
+ {
+ notifyPropertyChangedEventHandler();
+ }
+}
diff --git a/ImagePlay/src/MainWindow.cpp b/ImagePlay/src/MainWindow.cpp
index de12a55..33ea0f3 100644
--- a/ImagePlay/src/MainWindow.cpp
+++ b/ImagePlay/src/MainWindow.cpp
@@ -456,6 +456,7 @@ void MainWindow::loadProcesses()
_factory->registerProcess("IPLCamera", new IPLCamera);
//_factory->registerProcess("IPLLoadVideo", new IPLLoadVideo);
_factory->registerProcess("IPLLoadImageSequence", new IPLLoadImageSequence);
+ _factory->registerProcess("IPLScreenshot", new IPLScreenshot);
_factory->registerProcess("IPLSaveImage", new IPLSaveImage);
_factory->registerProcess("IPLSplitPlanes", new IPLSplitPlanes);
_factory->registerProcess("IPLMergePlanes", new IPLMergePlanes);