Borrar filtros
Borrar filtros

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

24 visualizaciones (últimos 30 días)
Dylan Zhu
Dylan Zhu el 17 de Jun. de 2024
Comentada: Dylan Zhu el 3 de Jul. de 2024 a las 18:45
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 comentarios
dpb
dpb el 17 de Jun. de 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 el 17 de Jun. de 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...

Iniciar sesión para comentar.

Respuesta aceptada

dpb
dpb el 17 de Jun. de 2024
Movida: dpb el 17 de Jun. de 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 comentarios
dpb
dpb el 27 de Jun. de 2024 a las 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) )
Dylan Zhu
Dylan Zhu el 3 de Jul. de 2024 a las 18:45
Hmm ok got it, thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by