'drawfreehand()' not working for lenovo touchscreen in appdesigner

5 visualizaciones (últimos 30 días)
Potoo Jones
Potoo Jones el 5 de Dic. de 2022
Comentada: Magnus el 4 de Nov. de 2024 a las 9:39
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 comentarios
Kevin Holly
Kevin Holly el 6 de Dic. de 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
Amal Raj el 20 de Mzo. de 2023
Hi,
I'm reposting your comment as an answer because it may be of assistance to others who are experiencing the same problem.

Iniciar sesión para comentar.

Respuestas (1)

Amal Raj
Amal Raj el 20 de Mzo. de 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 comentario
Magnus
Magnus el 4 de Nov. de 2024 a las 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

Iniciar sesión para comentar.

Categorías

Más información sobre Develop uifigure-Based Apps en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by