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

5 ビュー (過去 30 日間)
Potoo Jones
Potoo Jones 2022 年 12 月 5 日
コメント済み: Magnus 2024 年 11 月 4 日 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 件のコメント
Kevin Holly
Kevin Holly 2022 年 12 月 6 日
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 2023 年 3 月 20 日
Hi,
I'm reposting your comment as an answer because it may be of assistance to others who are experiencing the same problem.

サインインしてコメントする。

回答 (1 件)

Amal Raj
Amal Raj 2023 年 3 月 20 日
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 件のコメント
Magnus
Magnus 2024 年 11 月 4 日 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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by