[vtkusers] How to clear canvas using vtkImageCanvasSource2D?

Kee Tang ktang at profoundmedical.com
Thu Jul 15 10:05:35 EDT 2010


Good to know.  Thanks for your help David!

Kee

-----Original Message-----
From: daviddoria at gmail.com [mailto:daviddoria at gmail.com] On Behalf Of David
Doria
Sent: Thursday, July 15, 2010 2:42 AM
To: Kee Tang
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] How to clear canvas using vtkImageCanvasSource2D?

On Wed, Jul 14, 2010 at 10:48 AM, Kee Tang <ktang at profoundmedical.com>
wrote:
> Hi All,
>
>
>
> I saw a couple postings on this question but no answers
Does anyone know
how
> to add a drawing object (e.g. FillTube) on the vtkImageCanvasSource2D then
> remove it afterwards?  Essentially I’d like to know how to clear the
canvas
> so I can redraw on it repeatedly.
>
> My current solution is to SetDrawColor(0,0,0,0) then use FillBox(0,
> m_CanvasSize-1, 0, m_CanvasSize-1) to clean the canvas but I’m worried
this
> will continually add objects on the canvas without actually deleting
> previous objects.
>
> Thanks,
> K

As far as I understand, the FillBox type methods simply set pixel
values in the image object. There is no collection of objects stored,
which means you would have to do the keeping track of the hierarchy
manually if you wanted to delete an "object" from the canvas. The good
news is that this means clearing the image with FillBox is ok.

David




More information about the vtkusers mailing list