Hi, David,<br><br>I follow your tips. It doesn't work. The text is still displayed at the default position.<br><br>Thanks<br>Liu Peng <br><div><br><br></div>
<span>
</span>
<br> 在2016-10-24,"David Lonie" <david.lonie@kitware.com> 写道:
<blockquote id="isReplyContent" style="padding-left:1ex; margin: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>
<b>收件人:</b>"Liu_tj" <tjlp@netease.com><br>
<b>抄送:</b>"vtkusers" <vtkusers@vtk.org><br>
<b>主题:</b>Re: [vtkusers] Why is the text of vtkCaptionWidget displayed at the default position no matter what position value I set?<br>
<br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 23, 2016 at 11:13 AM, Liu_tj <span dir="ltr"><<a href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi, VTK guys,<br><br>When I display a vtkCaptionWidget, I want to set the position of the text. So I call the vtkActor2D:;SetPostion() and SetPosition2(), but when the widget is displayed, the text is alway at the left bottom corner, why? Below is my C# code:<br>[snip]<br>rep.GetCaptionActor2D().<wbr>GetTextActor().SetPosition(<wbr>textPos1[0], textPos1[1]);<br>rep.GetCaptionActor2D().<wbr>GetTextActor().SetPosition2(<wbr>textPos2[0], textPos2[1]);<br></wbr></wbr></wbr></wbr></div></blockquote><div><br></div><div>Try just setting the position of the caption actor itself. When the caption actor renders, it sets the text actor's position. So,</div><div><br></div><div>rep.GetCaptionActor2D().SetPosition(<wbr>textPos1[0], textPos1[1]);</wbr></div><div>rep.GetCaptionActor2D().SetPosition2(<wbr>textPos2[0], textPos2[1]);</wbr></div><div><br></div><div>should get you what you want.</div><div><br></div><div>HTH,</div><div>Dave</div></div></div></div>
</blockquote><br><br><span title="neteasefooter"><p> </p></span>