Is it possible to create transparent font on a graphics component?

10 次查看(过去 30 天)
Dr. RooB
Dr. RooB2018-3-26
回答: cui ,2021-9-13
I would like to create a text object which has transparent lettering, not just a transparent background. Id rather not have to convert it to an image as I want to still use the text properties/methods after creating the object in response to user input.

回答(2 个)

Walter Roberson
Walter Roberson 2018-3-26
Ummm, so where ever the transparent text is placed, the object "underneath" it along the line of sight should be made transparent? If there are multiple layers then should only the top-most along the line of sight be made transparent or everything all the way through? If there are two objects at equal distance along the line of sight then should they both be made transparent or should only one of them be, paying attention to to sortorder
https://blogs.mathworks.com/graphics/2014/11/04/sortmethod/
Now if it is to pay attention to sortorder then notice in Mike's 2D example that outlines can end up being drawn: how should a "one layer exposed only" rule be processed at those edges?
OK, and to confirm, exactly what is made transparent is to vary in real time as the user rotates the scene in three-space?
Would it be acceptable to to simply grab the axes background color and render the font in that? That would typically be an off-white.
  2 个评论
Walter Roberson
Walter Roberson 2018-3-26
You only want semi-transparent -- you want to specify an alpha parameter.
Alpha is not a documented property of text objects but it does exist. I am away from my desktop at the moment so I cannot check the details but I remember seeing it there. I would tend to suspect that Yair has documented it on his undocumentedmatlab site.
I probably will not be able to research this for about 10 or 12 hours so check his site.

请先登录,再进行评论。


Community Treasure Hunt

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

Start Hunting!

Translated by