Thread: Ocr
-
September 15th, 2004, 10:11 PM
#1
Ocr
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.
It is better to die on your feet than to live on your knees.
-
September 15th, 2004, 10:38 PM
#2
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.
-
September 15th, 2004, 10:59 PM
#3
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++.
It is better to die on your feet than to live on your knees.
-
September 16th, 2004, 01:20 AM
#4
Do tell what proggy you found that can do that? It may help out some poor sod sometime.
peace
Mankind have a great aversion to intellectual labor; but even supposing knowledge to be easily attainable, more people would be content to be ignorant than would take even a little trouble to acquire it.
- Samuel Johnson
-
September 16th, 2004, 01:24 AM
#5
GOCR
Also, I came up with this code:
Code:
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);
}
Can someone please fill in the part to save the image?
It is better to die on your feet than to live on your knees.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|