I would like to ba able to extraxt text from what is on my screen using the function ExtTextOut but I am a rookie in C++. I am using Qt and I would like to have a simple example that I could reproduce in my code when I need to extract text. For example, if I want to extract this text and stock it in a document, how can I do it?
I wrote the short code below, but I don’t know how to go further?
#include <QApplication>
#include <windows.h>
#include <QCursor>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCursor::setPos(20,100);
exttextout(20,100);
return app.exec();
}
The ExtTextOut() function draws text using the currently selected font, background color, and text color. You can optionally provide dimensions to be used for clipping, opaquing, or both.
hdc [in]A handle to the device context.
X [in]The x-coordinate, in logical coordinates, of the reference point used to position the string.
Y [in]The y-coordinate, in logical coordinates, of the reference point used to position the string.
fuOptions [in]Specifies how to use the application-defined rectangle. This parameter can be one or more of the following values.
For more details visit the MSDN forum
.
is a blunder and you can’t read text from screen just like that. You have to use some image processing software in order to do that. I think it would be a better option if you could club MATLAB with your program.