Specify rotation center to the GraphObject and rotate
BOOL Rotate( double dAngle, point * ptCenter, BOOL bUndo = FALSE )
TRUE for success
EX1
// new Graph window, add a rectangle object, object name is Rect // set rotation center to (2000,3000) and rotation angle 45: test_rotate("Rect", 2000, 3000, 45) // set rotation center to top left corner and rotation angle -15: test_rotate("Rect", 0, 0, -15) void GraphObject_Rotate_ex(string name, int x, int y, int degree) { GraphObject gr; GraphLayer gl = Project.ActiveLayer(); if(gl) gr= gl.GraphObjects(name); if(gr) { point pt(x, y); //specify x, y in pixel gr.Rotate(degree, &pt, true); gl.GetPage().Refresh(); } }
origin.h