Forum Discussion
I tried the second option which is the OCR. The picture of the popup window is captured but the method to GetText is caused textcomplete to crash. the error is in PMP2TextServer.dll.
Here is my code
var popup = getPopupWindow(app);
if (popup !=null)
{
TextToFind = "Yes";
Pic = popup.Picture(0, 0, popup.Width, popup.Height, false);
Log.Picture(Pic, "Popup Wnd."); -- this is ok, i get the screenshot for the popup window
OCRObjList = OCR.CreateObject(Pic); -- this Ok, no exception is occured
OCROptionsList = OCRObjList.CreateOptions(); -- Ok
FontItem = OCROptionsList.Fonts.Add(); -- Ok
FontItem.Name = "Tahoma"; -- Ok
FontItem.Sizes.Add(12); -- OK
Log.Message("Added OCR Options"); -- Ok
OCRObjList.GetText(); --- EXCEPTION - BMP2TextServer.dll... Textcomplete is crashed
FindRes = OCRObjList.FindRectByText(TextToFind, OCROptionsList); --- EXCEPTION - BMP2TextServer.dll... Textcomplete is crashed
Log.Message("FindRes");
if (FindRes)
{
Log.Message("The coordinates of the center of the found area. FoundX = " +
aqConvert.IntToStr(OCRObjList.FoundX) + "; FoundY = " + aqConvert.IntToStr(OCRObjList.FoundY) + ".");
popup.Click(OCRObjList.FoundX, OCRObjList.FoundY);
Related Content
- 3 years ago
- 10 years ago
- 3 years ago
- 6 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago