Azzera filtri
Azzera filtri

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

24 visualizzazioni (ultimi 30 giorni)
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 Commenti
dpb
dpb il 17 Giu 2024
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 il 17 Giu 2024
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...

Accedi per commentare.

Risposta accettata

dpb
dpb il 17 Giu 2024
Spostato: dpb il 17 Giu 2024
<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 Commenti
dpb
dpb il 27 Giu 2024 alle 15:24
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) )

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by