[vtkusers] vtkImageCanvasSource2D ScalarType

David Doria daviddoria+vtk at gmail.com
Mon Dec 14 17:45:59 EST 2009


On Mon, Dec 14, 2009 at 5:36 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Mon, Dec 14, 2009 at 3:20 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> I looked at the source code. Something you could have done. It's a
>> learning experience...
>
> The source code is the only complete documentation for VTK, and it's
> the only documentation that I fully trust.  And I'm not talking about
> code comments here, either, I mean the actual source code itself.  I
> always go to the source code before I go to doxygen or anywhere
> else... vim and grep are much faster than a web browser, too.
>
>   David
>

Thanks guys. For the next reader, the image should be initialized to
black like this:

  vtkSmartPointer<vtkImageCanvasSource2D> drawing =
vtkSmartPointer<vtkImageCanvasSource2D>::New();
  drawing->SetScalarTypeToUnsignedChar();
  drawing->SetExtent(0, 20, 0, 50, 0, 0);
  drawing->FillBox(0,20,0,50);

Thanks,

David



More information about the vtkusers mailing list