%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
GetUserRect Method
See Also  Example
vdWebLibrary Namespace > vdrawObj Class : GetUserRect Method
statechangeDelegate
A function created using the onStateChangedDelegate as model.
Initiates an action (check BaseActionObj) where the user will create a new line in the component's drawing area.

Syntax

JScript 
public function GetUserRect( 
   statechangeDelegate : onStateChangedDelegate
);

Parameters

statechangeDelegate
A function created using the onStateChangedDelegate as model.

Example

C#Copy Code
  
function CmdZoomWindow(canvasId) { 
    var vdcanvas = vdmanager.vdrawObject(canvasId); 
    vdcanvas.GetUserRect(_onActioncmdZoomStateChanged); 

function _onActioncmdZoomStateChanged(action, status) { 
    var vdcanvas = action.vdrawOwner(); 
    if (status == 'start') { 
        action.DispProps = (vdConst.ACTION_DISPLAY_DEFAULT ^ vdConst.ACTION_DISPLAY_USEFILLCOLOR); 
        vdcanvas.Prompt('pick first corner'); 
    } else if (status == 'count') { 
        vdcanvas.Prompt('pick second corner'); 
    } else if (status == 'end') { 
        vdcanvas.Prompt(':'); 
        if (!action.IsCanceled()) { 
            vdcanvas.zoomwindow(action.ResValue[0], action.ResValue[1]); 
            vdcanvas.redraw(); 
        } 
    } 
}

See Also