'drawfreehand()' not working for lenovo touchscreen in appdesigner
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to setup a simple app in appdesigner that will let the user draw using a touchscreen with the drawfreehand() command. However the drawfreehand() command seems to be ignoring input from the touchscreen on my Lenovo X1 Yoga Gen 7, which is odd because I'm able to still click buttons and interact with the rest of the app using the touchscreen.
The app has a draw button, a clear button, and an axis to draw on as seen below.
To call the draw function, the draw button has the following "buttonPushed" callback
function DrawButtonPushed(app, event)
h = drawfreehand(app.UIAxes, 'Closed',0);
h.FaceSelectable = false;
h.HandleVisibility = 'off';
h.InteractionsAllowed = 'none';
h.Smoothing = 0;
h.FaceAlpha = 0;
end
And this seems to work, as long as I'm using the trackpad or a mouse. For some reason when I use the touchscreen with the thinkpad pen nothing happens. What's confusing me however is that if I remove the call to the UIAxes and instead try the following code:
function DrawButtonPushed(app, event)
h = drawfreehand('Closed',0);
h.FaceSelectable = false;
h.HandleVisibility = 'off';
h.InteractionsAllowed = 'none';
h.Smoothing = 0;
h.FaceAlpha = 0;
end
Then a new figure is generated in a seperate window and in that window the touchscreen works fine and I'm able to draw, however I'd prefer to keep the drawings on the same UI axis within the app.
I was curious if anyone else has run into problems with matlab apps working on a touchscreen and might have suggestions.
2 commentaires
Kevin Holly
le 6 Déc 2022
I have reproduced the issue. The touchscreen isn't working when axes/uiaxes are place on a uifigure, which App Designer uses. I have reported the issue to our development team.
This does not work:
fig = uifigure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
This does:
fig = figure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
Amal Raj
le 20 Mar 2023
Hi,
I'm reposting your comment as an answer because it may be of assistance to others who are experiencing the same problem.
Réponses (1)
Amal Raj
le 20 Mar 2023
I have reproduced the issue. The touchscreen isn't working when axes/uiaxes are place on a uifigure, which App Designer uses. I have reported the issue to our development team.
This does not work:
fig = uifigure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
This does:
fig = figure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
1 commentaire
Magnus
le 4 Nov 2024 à 9:39
Is there any update on this? I am having the same issue using a Wacom Intuos graphpad. Works perfectly for a normal figure, but not in uifigure
Voir également
Catégories
En savoir plus sur Develop uifigure-Based Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!