[vtkusers] How to change font size in a vtkCaptionActor2D?

Mathieu Coursolle mcoursolle at yahoo.ca
Wed Dec 8 15:47:19 EST 2004


Hi, 
I created a vtkCaptionActor2D to display text at a specified
coordinate. Everything works fine except that whatever the font
size I set, it is always the same. I just cannot modify the font
size, and the default one is just too big. 
Any idea of what I am doing wrong?
Thank you!
 
Mathieu
 
---

//Create an actor to display the caption.

vtkCaptionActor2D* caption_actor = vtkCaptionActor2D::New();





//Create a property for the actor. 


vtkTextProperty* property = vtkTextProperty::New();



//Set the color to green and font to arial. 


property->SetColor(0, 1, 0);

property->SetFontFamilyToArial();



property->SetFontSize(12); //<<----That line has no effect???

//Set the actor properties.

caption_actor->SetCaptionTextProperty(property);

//Remove the caption borders.

caption_actor->SetBorder(FALSE);

//Set the caption.

caption_actor->SetCaption("My caption...");







//Set the attachment point. 


caption_actor->SetAttachmentPoint(x, y, z);

//Add the caption into the renderer.

m_renderer->AddActor2D(caption_actor);



//Clear allocated memory.

caption_actor->Delete();

property->Delete();

 





---------------------------------
Post your free ad now! Yahoo! Canada Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041208/97124de0/attachment.htm>


More information about the vtkusers mailing list