[vtkusers] Annotating an image with text

David Gobbi david.gobbi at gmail.com
Wed Dec 9 15:16:27 EST 2009


On Wed, Dec 9, 2009 at 12:56 PM, Jérôme <jerome.velut at gmail.com> wrote:
> You are right. Writing a rendering process for annotating an image makes no
> sense. The vtkTextActor is not the solution. However, the vtkTextSource
> produces a vtkPolyData. I think that you can use this polydata through a
> vtkPolyDataToImageStencil in order to mask the image according to the text.

Unfortunately, vtkPolyDataToImageStencil was only designed to work on
3D polydata inputs that describe fully closed surfaces.  Updating it
to work with 2D polydata is on my to-do list but is very low priority,
i.e. there is less than a 50% chance that I will ever do it.  This
method would produce pretty crappy looking text, anyway.  The only way
to make the text look good is to somehow render it offscreen and grab
the bitmap, which can then be layered into the image.

   David



More information about the vtkusers mailing list