WorldToPage
Converts the world (i.e. axis scale) coordinates into the page (i.e. paper, logical) coordinates.
BOOL WorldToPage( int & nXPage, int & nYPage, double rXWorld, double rYWorld )
TRUE if success, otherwise FALSE.
EX1
//Create a rectangle object and set it's size according to page coordinates. void Layer_WorldToPage_ex1() { GraphPage gp; gp.Create(); GraphLayer gl = gp.Layers(0); double xmin = gl.X.From; double xmax = gl.X.To; double ymin = gl.Y.From; double ymax = gl.Y.To; int nLeft, nRight, nTop, nBottom; gl.WorldToPage(nLeft, nTop, xmin, ymax); gl.WorldToPage(nRight, nBottom, xmax, ymin); GraphObject goRect = gl.CreateGraphObject(GROT_RECT); // when newly created, somehow need to set Left/Top first, and then set width/height, then later to set Left/Top to // properly to set its Rect goRect.Left = nLeft; goRect.Top = nTop; goRect.Width = nRight - nLeft; goRect.Height = nBottom - nTop; goRect.Top = nTop; goRect.Left = nLeft; gp.Refresh(); }
Layer::PageToWorld
origin.h