Get matrix object xy mapping coordinates
BOOL GetXY( double & dXMin, double & dYMin, double & dXMax, double & dYMax )
BOOL GetXY( vector &vXScale, vector& vYScale = NULL )
TRUE if success, otherwise FALSE.
EX1
// Matrix must be active window void MatrixObject_GetXY_Ex1() { MatrixLayer ml = Project.ActiveLayer(); if( ml ) { MatrixObject mo = ml.MatrixObjects(0); double x1, x2, y1, y2; mo.GetXY(x1, y1, x2, y2); printf("Matrix XY map: x = (%g, %g), y = (%g, %g)\n", x1,x2, y1, y2); } else printf("No active matrix\n"); }
EX2
// Matrix window should be the active window // SYNTAX : Matrix_Object_GetXY_Ex2() or (200) or (200, 0) or (200, 0, 1) for example void MatrixObject_GetXY_Ex12(int nRows = 100, int nRestore = 1, int nFillData = 0) { MatrixLayer ml = Project.ActiveLayer(); // Get Active Window/Layer if( ml ) { MatrixObject mo = ml.MatrixObjects(0); // Get MatrixObject from layer DWORD dw = 0; if(nRestore) dw |= OCD_RESTORE; if(nFillData) dw |= OCD_INITDATA; mo.SetSize(nRows, 20, dw); printf("matrix has %d rows and %d columns\n", mo.GetNumRows(), mo.GetNumCols()); double x1, x2, y1, y2; mo.GetXY(x1, y1, x2, y2); printf("matrix XY: x = (%g, %g), y = (%g, %g)\n", x1,x2, y1, y2); } else printf("No active matrix\n"); }
EX3
// Matrix must be active window // SYNTAX : MatrixObject_GetXY_Ex3(50) for example void MatrixObject_GetXY_Ex3(int nr) { MatrixLayer ml = Project.ActiveLayer(); if( ml ) { MatrixObject mo = ml.MatrixObjects(0); mo.SetNumRows(nr); printf("matrix has %d rows and %d columns\n", mo.GetNumRows(), mo.GetNumCols()); double x1, x2, y1, y2; mo.GetXY(x1, y1, x2, y2); printf("matrix XY: x = (%g, %g), y = (%g, %g)\n", x1,x2, y1, y2); } else printf("No active matrix\n"); }
Get matrix object xy mapping coordinates. All matrices have linearly mapped values for columns and rows.
MatrixObject::SetXY, Matrix::GetXMax, Matrix::GetYMin, Matrix::GetYMax, Matrix::SetXMin, Matrix::SetYMin, Matrix::SetXMax, Matrix::SetYMax
origin.h