setResizable
Set resize behavior of ROI object
setResizable is not recommended. With the new ROIs, use the
InteractionsAllowed property instead. For more information, see
Version History.
Syntax
Description
Examples
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
Version History
Introduced before R2006aStarting in R2018b, a new set of ROI objects replaces the existing set of ROI objects. The new objects provide more functional capabilities, such as face color transparency. The new classes also support events that you can use to respond to changes in your ROI such as moving or being clicked. Although there are no plans to remove the old ROI objects at this time, switch to the new ROIs to take advantage of the additional capabilities and flexibility. For more information on creating ROIs using the new ROI functions, see Create ROI Shapes.
To control whether an Ellipse or Rectangle ROI is resizable, use the
InteractionsAllowed property of the ROI.
Update all instances of setResizable used with the
Ellipse ROI and the Rectangle ROI.
| Discouraged Usage | Recommended Replacement |
|---|---|
This example uses the imshow('cameraman.tif')
h = imrect(gca,[10 10 100 100]);
setResizable(h,false);
| Create a imshow('camerman.tif') h = drawrectangle(gca,'Position',[10 10 100 100]); h.InteractionsAllowed = 'none'; |
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)