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

7 次查看(过去 30 天)
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 个评论
Dr. RooB
Dr. RooB 2018-3-26
Thanks for the fast response Walter. I've read many of your suggestions on this site to other people's questions and appreciate your contributions.
I'm trying to label regions in some relatively busy 2D graphs of signals vs time. I can get good results by overlaying mostly transparent patch objects on the graphs after they've been made. Now I'd like to put numbers in the patch objects I thought some transparent lettering that was just a little less transparent than the patch object would work well.
None of the transparency properties of the objects underneath the text need to change and I don't plan on doing this for 3D graphs. I'm thinking an object that supports html is likely the answer but I haven't worked out the opacity yet.
The link you sent did give me an idea to put the patch objects and non-transparent lettering on the bottom of the layer stack. This may give a good work around or perhaps a better looking end result.
Thanks!
Walter Roberson
Walter Roberson 2018-3-26
编辑: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.

请先登录,再进行评论。


cui,xingxing
cui,xingxing 2021-9-13

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by