Convert world to logical coordinates.
BOOL WorldToView( const double * pWorld, double * pView, int nCount, int nDim = 0 )
0 if success.
EX1
void WorldToView_ex1() { GraphLayer gl = Project.ActiveLayer(); if( gl ) { double world[2]; double view[2]; world[0] = 3.123456789012345; world[1] = 7.123456789012345; int nError = gl.WorldToView(world, view, 2); nError = gl.ViewToWorld(view, world, 2); } } void WorldToView_ex2(int nDim=1) { GraphLayer gl = Project.ActiveLayer(); if( gl ) { double dw = 3.123456789012345; double dv; double dd; int nError = gl.WorldToView(&dw, &dv, 1, nDim); nError = gl.ViewToWorld(&dv, &dd, 1, nDim); double diff = dd - dw; } }
Layer::ViewToWorld
origin.h