[vtkusers] How to put the text inside bounding box of vtkCaptionActor2D

Amy Squillacote amy.squillacote at kitware.com
Thu Mar 8 09:04:02 EST 2007


Hi Jesús,

Take a look at TestCaptionActor.tcl in VTK/Hybrid/Testing/Tcl. This test 
demonstrates putting a bounding box around some text.

- Amy

Jesús Spí­nola wrote:
> Hello,
>
> I want to put a text on the render window with a visible bounding box 
> around the text. I'm trying this with vtkCaptionActor2D but the text 
> always appears on top of the bounding box and never inside it.
>
> What I have to do to view the text inside the bounding box of the 
> vtkCaptionActor2D?
> Could some one post a code snippet that does this?
>
> My code looks like this
>
> vtkCaptionActor2D *captionActor = vtkCaptionActor2D::New();
> captionActor->SetCaption( "Some text....." );
> captionActor->LeaderOff();
> captionActor->SetPosition( topLeftX, topLeftY );
> captionActor->SetPosition2( bottomRightX, bottomRighY );
>
> Thanks!
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   

-- 
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106




More information about the vtkusers mailing list