How to change fontsize of label on freehand object using drawfreehand?

2 次查看(过去 30 天)
Hello! I am writing a script that makes the user draw a freehand object, then prompts them for a number, and finally attaches that number onto the produced ROI as a visible label. The currently generated label is nice but I was hoping to increase the fontsize to make it more visible on a screen. Is there a good way to do this? Thank you very much!
Below, I have included an executable sample of what I'm working with at the moment.
% Initiate drawfreehand function
Drawing = drawfreehand("Color","r", "LabelAlpha",1);
% Prompt User
prompt = "What value?\n";
Value = input(prompt);
% Set the freehand object's label
Drawing.Label = num2str(Value);
  3 个评论
dpb
dpb 2024-6-17
You can't Accept because I wrote it as a comment...I guess it really is the answer for this case despite the editorial comment; I'll go ahead and move it over.
Yes, I have used "TMW" as shorthand for "The Mathworks" for ages...
dpb
dpb 2024-6-17
There's no guarantee getundoc will find it, but it's the best tool out there for the purpose by far. As TMW gets more and more into this thing of building these custom objects, digging into their bowels gets harder and harder as well. It's misguided direction to pursue imo, but they're apparently totally committed down the path of making everything a "mother knows best!" solution, taking away the user's opportunity to do something other than what they've thought of and generously provided...

请先登录,再进行评论。

采纳的回答

dpb
dpb 2024-6-17
移动:dpb 2024-6-17
<drawfreehand> doesn't show that it exposes the FontSize property of the text object. Best you can do will be to save the object handle and <use Yair Altman's utility> to see if you can find it or the handle to the text object as a hidden property.
It is SO FRUSTRATING that TMW has started this thing about creating specialized graphics objects that are semi-opaque (or nearly black in some instances) instead of just creating the same effect as regular axes object so the user can make desired customizations.
  5 个评论
dpb
dpb 2024-6-27
Looks like it would be
LabelHandle: [1×1 Text]
You just have to start poking at the various things getundoc returns and see what they contain...I call it "handle diving" (from the obvious other type... :J) )

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by