GraphObject::Rotate

 

Description

Specify rotation center to the GraphObject and rotate

Syntax

BOOL    Rotate( double dAngle, point * ptCenter, BOOL bUndo = FALSE )

Parameters

dAngle
[input] Rotation angle
ptCenter
[input] a point object to specify rotation center's x y coordinates in pixel
bUndo
[input] set undoable

Return

TRUE for success

Examples

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();
    }
}

Remark

See Also

Header to Included

origin.h