SftPrintPreview/OCX 1.0

SftPrintPreview.HitTestPix Method

Softel vdm, Inc.

Determines the area at a given location.

Syntax       

VB.NET

object.HitTestPix(ByVal XPix As OLE_XPOS_PIXELS, ByVal YPix As OLE_YPOS_PIXELS, ByRef Row As Integer, ByRef Column As Integer, ByRef RelativeXPix As OLE_XSIZE_PIXELS, ByRef RelativeYPix As OLE_YSIZE_PIXELS, ByRef DistanceX As Double, ByRef DistanceY As Double)

VB

object.HitTestPix(ByVal XPix As OLE_XPOS_PIXELS, ByVal YPix As OLE_YPOS_PIXELS, Row As Integer, Column As Integer, RelativeXPix As OLE_XSIZE_PIXELS, RelativeYPix As OLE_YSIZE_PIXELS, DistanceX As Double, DistanceY As Double)

C#.NET

void object.HitTestPix(OLE_XPOS_PIXELS XPix, OLE_YPOS_PIXELS YPix, out short Row, out short Column, out OLE_XSIZE_PIXELS RelativeXPix, out OLE_YSIZE_PIXELS RelativeYPix, out double DistanceX, out double DistanceY);

VC++

HRESULT object->HitTestPix(OLE_XPOS_PIXELS XPix, OLE_YPOS_PIXELS YPix, short* Row, short* Column, OLE_XSIZE_PIXELS* RelativeXPix, OLE_YSIZE_PIXELS* RelativeYPix, double* DistanceX, double* DistanceY);

C

HRESULT object->raw_HitTestPix(OLE_XPOS_PIXELS XPix, OLE_YPOS_PIXELS YPix, short* Row, short* Column, OLE_XSIZE_PIXELS* RelativeXPix, OLE_YSIZE_PIXELS* RelativeYPix, double* DistanceX, double* DistanceY);

Delphi

procedure object.HitTestPix(XPix : Integer, YPix : Integer, out Row : Smallint, out Column : Smallint, out RelativeXPix : OLE_XSIZE_PIXELS, out RelativeYPix : OLE_YSIZE_PIXELS, out DistanceX : Double, out DistanceY : Double);

object

A SftPrintPreview object.

XPix

The x coordinate to be tested, relative to the top, left corner of the print preview control, in pixels. 

YPix

The y coordinate to be tested, relative to the top, left corner of the print preview control, in pixels.

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.

RelativeXPix

Returns the horizontal offset from the edge of the displayed page to the location X, Y, in pixels.

RelativeYPix

Returns the vertical offset from the edge of the displayed page to the location X, Y, in pixels.  

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 HitTestPix 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