Main Content

setResizable

Set resize behavior of ROI object

setResizable is not recommended. With the new ROIs, use the InteractionsAllowed property instead. For more information, see Compatibility Considerations.

Description

example

setResizable(h,TF) sets whether the ROI object may be resized interactively.

Examples

collapse all

Create an ellipse ROI object.

imshow("coins.png")
h = imellipse(gca,[10 10 100 100]);

Specify a position constraint function using makeConstrainToRectFcn to keep the ellipse inside the boundary of the image.

fcn = makeConstrainToRectFcn("imellipse",get(gca,"XLim"),get(gca,"YLim"));
setPositionConstraintFcn(h,fcn);

Click and drag with the mouse to try resizing, reshaping, and moving the ellipse.

Now, disable resizing the ellipse.

setResizable(h,false);

Click and drag the ellipse again. You can move it, but not change the size or shape of it.

Input Arguments

collapse all

ROI object, specified as an imellipse or imrect object.

Enable resizing of ROI object, specified as true or false.

Data Types: logical

Version History

Introduced before R2006a

expand all