Operating System: ARM-Linux graphical user interface: Qtopia Graphics Development Library: Qtqtopia is a comprehensive application platform for Trolltech's embedded Linux. Qtopia contains complete application layers, flexible user interfaces, window operations, application launches, and development frameworks. In addition, qtopia is based on QT / Embedded C class library, with unified application programming interfaces, support multi-tasking management, practicality.
Qt is a multi-platform C graphical user interface application framework developed by Trolltech, which provides the application developer to establish the functionality required for the art-graphical user interface. Qt is fully object-to-object, it is easy to expand and allow real component programming. Qt is also the basis for popular Linux desktop environment KDE. This article describes a method of intercepting a screen under QTOPIA. In fact, QTOPIA and QT support frame buffer technology, we can read the frame buffer data to screen data. But this approach needs to understand the device driver, and it is not so convenient to achieve it. Here is a method of intercepting a screen using a grabwidget with a grabwindow function in the QT library. The prototype of the two functions is as follows: qpixmap qpixmap :: grabwindow (wid window, int x = 0, int y = 0, int W = -1, int h = -1) WID represents the ID number of the intercepted window; x, y Indicates the starting standard of the interception range; W, H indicates the width and height of the intercept range, and if it is -1, all intercepted. Qpixmap qpixmap :: grabwidget (qimget * widget, int x = 0, int y = 0, int W = -1, int h = -1) Widget represents the accessible portion of the intercepted window, the remaining parameters are implemented with the code below GrabWindow. The interception of the current whole window. QPixMap Pixmap; // The graphics class in the QT library can handle all graphics types supported by QT, such as JPG, BMP, etc. QPixMap PIX;
PIX = pixmap.grabwindow (this-> Winid (), 0, 0, -1, -1); // this-> WinID () is to get the current window ID if (Pix.Inull ()) {QMESSAGEBOX :: Information (this, "error", "grab screen failed", qMessagebox :: ok;} else {if (pix.save ("/tmp/grab.bmp", "bmp") == false) {QMESSAGEBOX :: Information (this, "right", "save error", qMessagebox :: ok;} else qMessagebox :: information (this, "grab", "bitmap saved as /tmp/grab.bmp" ,qmessagebox :: OK); Change the grabwindow to the grabwidget to achieve the acquisition of the canvas data.