2.2.4.27.25 MatrixLayer::XYtoColRow


Description

Find matrix indecies from X Y

Syntax

BOOL XYtoColRow( double * pxy, UINT * pnCol, UINT * pnRow )

Parameters

pxy
[input] pointer to array of size 2 with x and y
pnCol
[output] resulting column index
pnRow
[output] resulting row index

Return

FALSE if x y outside of the matrix XY area.

Examples

EX1

void ExportMultiFrame_ex(double x, double y)
{
	MatrixLayer ml = Project.ActiveLayer();
	if(!ml)
		return;
	
	double xy[2];
	xy[0] = x; xy[1] = y;
	UINT nCol, nRow;
	if( ml.XYtoColRow(xy, &nCol, &nRow) )
		printf("nCol = %d, nRow = %d\n", nCol, nRow);	
}

Remark

See Also

Header to Included

origin.h