mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Create test program for creating screenshot with Qt
Former-commit-id: 7e665ef0cd63f66c34ba2b441cafe34689358f3a
This commit is contained in:
parent
feb88d56bd
commit
eb4170c316
@ -48,3 +48,7 @@ target_link_libraries(test_blackborderprocessor
|
|||||||
add_executable(test_qregexp TestQRegExp.cpp)
|
add_executable(test_qregexp TestQRegExp.cpp)
|
||||||
target_link_libraries(test_qregexp
|
target_link_libraries(test_qregexp
|
||||||
${QT_LIBRARIES})
|
${QT_LIBRARIES})
|
||||||
|
|
||||||
|
add_executable(test_qtscreenshot TestQtScreenshot.cpp)
|
||||||
|
target_link_libraries(test_qtscreenshot
|
||||||
|
${QT_LIBRARIES})
|
||||||
|
20
test/TestQtScreenshot.cpp
Normal file
20
test/TestQtScreenshot.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
// STL includes
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
// QT includes
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#include <QPixmap>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
|
||||||
|
|
||||||
|
std::cout << "Grabbed image: [" << originalPixmap.width() << "; " << originalPixmap.height() << "]" << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user