Chinese Simplified (简体中文)

OnCorrectPerspective Method of the IImageViewerEvents Interface

This method is implemented on the client-side. It is called by ABBYY FineReader Engine before correcting perspective distortions on image pages in Image Viewer. The process is invoked, if Correct this image button is clicked in the Correct Trapezium Distortions section of the Image Editor dialog box.

The method delivers to the client the index of the page which is going to be changed, and the coordinates of the new page corners. With the help of this method it is possible to cancel the operation.

See the illustration

Syntax

C++

HRESULT OnCorrectPerspective(
  int           PageIndex,
  IPoint*       TopLeft,
  IPoint*       TopRight,
  IPoint*       BottomRight,
  IPoint*       BottomLeft,
  VARIANT_BOOL* Cancel
);
    

C#

void OnCorrectPerspective(
  int      PageIndex,
  IPoint    TopLeft,
  IPoint    TopRight,
  IPoint    BottomRight,
  IPoint    BottomLeft,
  out bool Cancel
);
    

Visual Basic .NET

Sub OnCorrectPerspective( _
  PageIndex As Integer, _
  TopLeft As IPoint, _
  TopRight As IPoint, _
  BottomRight As IPoint, _
  BottomLeft As IPoint, _
  ByRef Cancel As Boolean _
)
    

Parameters

PageIndex
[in] Contains the index of the page for which the trapezium distortions are going to be corrected.
TopLeft
[in] Contains the coordinates of the point on the image which will be the new left top corner of the corrected image. See the description of the Point object.
TopRight
[in] Contains the coordinates of the point on the image which will be the new right top corner of the corrected image. See the description of the Point object.
BottomRight
[in] Contains the coordinates of the point on the image which will be the new right bottom corner of the corrected image. See the description of the Point object.
BottomLeft
[in] Contains the coordinates of the point on the image which will be the new left bottom corner of the corrected image. See the description of the Point object.
Cancel
[out] You may set this variable to TRUE to indicate that the process should be terminated. In this case, perspective distortions will not be corrected.

Return values

[C++ only] If this method returns a value other than S_OK, it indicates that an error occurred on the client-side, and in this case the value of the Cancel parameter is not taken into account.

Remarks

The client implementation of this method must assure that all exceptions thrown inside the method are caught and handled and no exceptions are propagated outside the method. Propagation of an exception outside the method may lead to unpredictable results (such as program termination).

See also

IImageViewerEvents

17.09.2024 15:14:41

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.