CitrixParseTextFuzzy Function

Action

This function performs optical character recognition (OCR) on a selected screen region and stores the result in a sResult parameter. Screen regions can be specified absolutely or relative to a window (by specifying a window handle).

Note: OCR operations are only possible in Normal Mode (see CitrixInit). This function fails when used in Fast Mode. When the optional font parameters are present, the pattern file is checked for the used font’s availability. When the parameters are omitted font checking is not performed.

CitrixParseTextFuzzy performs OCR more exactly than CitrixParseText but requires more resources.

Include file

CitrixAPI.bdh

Syntax

CitrixParseTextFuzzy( out sResult    : string,
                      in  nWindow    : number,
                      in  nX         : number,
                      in  nY         : number,
                      in  nWidth     : number,
                      in  nHeight    : number,
                      in  sLanguage  : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sResult String variable that receives the converted text.
nWindow Window handle returned by a call to CitrixWaitForWindowCreation. Use DESKTOP to specify a region relative to the desktop.
nX X coordinate of the left margin of the screen region.
nY Y coordinate of the top margin of the screen region.
nWidth Width of the region.
nHeight Height of the region
sLanguage The language of the text to be verified. Possible language codes are chi_sim, dan, deu, eng, fin, fra, it, jpn, nld, nor, pol, spa and swe.

Example

  transaction TMain
  var
    sParam1 : string;
  begin
    CitrixInit(640, 480); // do not change the resolution
    CitrixConnect("lab1", "user", "password", "domain", COLOR_16bit);
    CitrixWaitForLogon();
    CitrixParseTextFuzzy(sParam1, DESKTOP, 73, 109, 74, 23, "eng"); 
    Print("sParam1: " + sParam1);
    CitrixDisconnect();
  end TMain;