Rotate image in Matlab app designer
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I was able to get an image rotated using Matlab GUI. I am now trying to implement the same effects using Matlab App Designer. Can you direct me as to how I can go about rotating the image using App designer with a slider.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168123/image.png)
Here is an extract of the code putting the image in the UIaxes:
% Code that executes after component creation
function startupFcn(app)
imshow('cameraman.tif','Parent',app.UIAxes)
end
% Value changing function: SteeringSlider
function SteeringSliderValueChanging(app, event)
changingValue = event.Value;
end
How to now rotate the image?
Thanks.
0 commentaires
Réponses (1)
Rajesh Balagam
le 16 Oct 2017
Modifié(e) : Rajesh Balagam
le 16 Oct 2017
You need to store the image data in the app using a custom public property and access this data to rotate the image in the callback for slider.
Store the image data:
app.imageData = imread('cameraman.tif');
rotatedImage = imrotate(app.imageData, changingValue);
Refer to this link ( https://www.mathworks.com/help/matlab/creating_guis/share-data-across-callbacks-in-app-designer.html) on how to share data between callbacks in appdesigner.
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!