SftPrintPreview/OCX 1.0

SftPrintPreview.HitTest Method

Softel vdm, Inc.

Determines the area at a given location.

Syntax       

VB.NET

object.HitTest(ByVal X As Single, ByVal Y As Single, ByRef Row As Integer, ByRef Column As Integer, ByRef RelativeX As Single, ByRef RelativeY As Single, ByRef DistanceX As Double, ByRef DistanceY As Double)

VB

object.HitTest(ByVal X As Single, ByVal Y As Single, Row As Integer, Column As Integer, RelativeX As Single, RelativeY As Single, DistanceX As Double, DistanceY As Double)

C#.NET

void object.HitTest(float X, float Y, out short Row, out short Column, out float RelativeX, out float RelativeY, out double DistanceX, out double DistanceY);

VC++

HRESULT object->HitTest(float X, float Y, short* Row, short* Column, float* RelativeX, float* RelativeY, double* DistanceX, double* DistanceY);

C

HRESULT object->raw_HitTest(float X, float Y, short* Row, short* Column, float* RelativeX, float* RelativeY, double* DistanceX, double* DistanceY);

Delphi

procedure object.HitTest(X : Single, Y : Single, out Row : Smallint, out Column : Smallint, out RelativeX : Single, out RelativeY : Single, out DistanceX : Double, out DistanceY : Double);

object

A SftPrintPreview object.

X

The x coordinate to be tested, relative to the top, left corner of the print preview control.  The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used. 

Y

The y coordinate to be tested, relative to the top, left corner of the print preview control.  The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.

Row

Returns the zero-based row number of the page number located at X, Y.  If no preview page is located at X, Y, Row and Column return -1 and other returned values are undefined.

Column

Returns the zero-based column number of the page number located at X, Y.  If no preview page is located at X, Y, Row and Column return -1 and other returned values are undefined.

RelativeX

Returns the horizontal offset from the edge of the displayed page to the location X, Y.   The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.

RelativeY

Returns the vertical offset from the edge of the displayed page to the location X, Y.   The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.

DistanceX

Returns the horizontal offset from the edge of the page to the location X, Y in inches.  This is the actual distance on a printed page.

DistanceY

Returns the vertical offset from the edge of the page to the location X, Y in inches.  This is the actual distance on a printed page.

Comments

The HitTest method determines the area at a given location.

The HitTest and HitTestPix methods are synonyms, but may use different coordinate systems.

The FirstPage property can be used to determine the first page displayed in multi-page mode (ZoomFactor property is 0).  The page located at X, Y can be determined using FirstPage + Row * PageGroups + Column.

In single-page mode, the CurrentPage property contains the current page number (ZoomFactor property is set to a value other than 0).  The page located at X, Y is the current page.


Feedback / comments / error reports for this topic
© 2004 - Softel vdm, Inc. - www.windowscontrols.com