[vtkusers] Why the vtkTextProperty.SetFontSize() does not take effect?

Liu_tj tjlp at netease.com
Tue Sep 20 10:15:09 EDT 2016


Hi, David,


There is no member method GetTextProperty() for vtkCaptionActor2D. No matter how much the font size is, the display is the same. And I found a similar post http://public.kitware.com/pipermail/vtkusers/2004-June/024902.html which is not answered.


在2016-09-20,"David Lonie" <david.lonie at kitware.com> 写道: -----原始邮件-----
发件人:"David Lonie" <david.lonie at kitware.com>
发送时间:2016年09月20日 星期二
收件人:"Liu_tj" <tjlp at netease.com>
抄送:"vtkusers" <vtkusers at vtk.org>
主题:Re: [vtkusers] Why the vtkTextProperty.SetFontSize() does not take effect?


On Sat, Sep 17, 2016 at 11:26 AM, Liu_tj <tjlp at netease.com> wrote:

Hi,

I use vtkCaptionWidget to display text annotation on 3D model. My issue is the font size of the text. Below is my C# code:

vtkCaptionRepresentation rep = vtkCaptionRepresentation.New();
rep.GetCaptionActor2D().ThreeDimensionalLeaderOff();
rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontSize(100);
rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontFamily(4);
rep.GetCaptionActor2D().GetTextActor().GetTextProperty().SetFontFile("simsunb.ttf");
rep.GetCaptionActor2D().GetCaptionTextProperty().SetColor(0.0, 1.0, 0.0);


Try setting it on rep.GetCaptionActor2D().GetTextProperty() instead of rep.GetCaptionActor2D().GetTextActor().GetTextProperty().


Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160920/87585f56/attachment.html>


More information about the vtkusers mailing list