I'm writing a c++ program, and I want it to take a screenshot and run that screenshot through an OCR program, outputting a text file. Is that possible?
Thanks for any help, I'll need it. ;)
Printable View
I'm writing a c++ program, and I want it to take a screenshot and run that screenshot through an OCR program, outputting a text file. Is that possible?
Thanks for any help, I'll need it. ;)
We use to use OmniPage Pro on our scanners with good results, not sure if it will work directly from a screen shot. If all else fails you could print out the screen shot and OCR it with a scanner and Omnipage. Try looking in googe for some freeware OCR software.
Printing and scanning won't work, because I need to check the screen often enough that it needs to be automated.
I found a program to meet my needs, now I just need to know how to take a screenshot from c++.
Do tell what proggy you found that can do that? It may help out some poor sod sometime.
peace
GOCR
Also, I came up with this code:
Can someone please fill in the part to save the image? :rolleyes: :DCode:void CaptureScreen()
{
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktopWnd = GetDesktopWindow();
HDC hDesktopDC = GetDC(hDesktopWnd);
HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,
nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight,h DesktopDC,0,0,SRCCOPY);
//Here I need some code to save the image.
ReleaseDC(hDesktopWnd,hDesktopDC);
DeleteDC(hCaptureDC);
DeleteObject(hCaptureBitmap);
}