<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV>Hello everyone,</DIV>
<DIV> </DIV>
<DIV>does anyone know a possibility to generate a vtkImageData-Object containing
graphical data and text in a dynamic way?</DIV>
<DIV> </DIV>
<DIV>It is possible to solve this problem by adding the graphical data and the
text to an actor and using the<BR>vtkWindowToImageFilter to generate a
vtkImageData-object from the vtkRenderWindow-object.</DIV>
<DIV> </DIV>
<DIV><BR>//
**********************************************************************<BR>Example:</DIV>
<DIV> </DIV>
<DIV>vtkRenderWindow *renderWindow = vtkRenderWindow::New();<BR>vtkRenderer
*renderer = vtkRenderer::New();<BR>...</DIV>
<DIV> </DIV>
<DIV>vtkTextActor *text = vtkTextActor::New();<BR>text->SetPosition(10,10);
<BR>text->SetInput("Hello World!");</DIV>
<DIV> </DIV>
<DIV>vtkTextProperty *textProp =
text->GetTextProperty();<BR>textProp->SetFontSize(12);<BR>textProp->SetJustificationToLeft();<BR>textProp->BoldOn();<BR>textProp->SetColor(0,0,0);</DIV>
<DIV> </DIV>
<DIV>renderer->AddActor2D(text);</DIV>
<DIV> </DIV>
<DIV>...</DIV>
<DIV> </DIV>
<DIV>renderWindow->AddRenderer(renderer);<BR>renderWindow->Render();</DIV>
<DIV><BR>vtkWindowToImageFilter *windowToImage =
vtkWindowToImageFilter::New();</DIV>
<DIV> </DIV>
<DIV>windowToImage->SetInput(renderWindow);<BR>windowToImage->Update();</DIV>
<DIV> </DIV>
<DIV>vtkImageData *resultImage = windowToImage->GetOutput();</DIV>
<DIV> </DIV>
<DIV>//
**********************************************************************</DIV>
<DIV> </DIV>
<DIV><BR> <BR>But I guess there must be a better way to generate the
vtkImageData-object without using any kind of rendering.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thank you in advance,<BR>Andreas</DIV></FONT></DIV></BODY></HTML>