[vtkusers] vtkBMPWriter

Naoko Takaya takaya at cv.cs.ritsumei.ac.jp
Wed Nov 8 02:57:33 EST 2000


Dear Vtkusers!!

I'm trying to write bmp files.
I have set the scalars to unsigned char but
it keeps giving me errors saying
" ERROR: In ....vtkBMPWriter.cxx, line 149
vtkBMPWriter (0x00824430): PNMWriter only accepts unsigned char scalars!"

My brief code is the following:
----------------------------------------------------------------------------
----
vtkStructuredPoints *vVol = vtkStructuredPoints::New();

vtkScalars *vScalars = vtkScalars::New();
vScalars->SetDataTypeToUnsignedChar();
...
vScalars->InsertScalar(offset, SomeValue);
vVol->GetPointData()->SetScalars(vScalars);

vtkBMPWriter *vWriter = vtkBMPWriter::New();
vWriter -> SetInput(vVol);
vWriter -> SetFileName("Name.bmp");
vWriter -> Write();
----------------------------------------------------------------------------
-----
Am I missing something?
Please help. Any help would be appreciated!!

Naoko

***********************************

                Naoko Takaya
      e-mail: takaya at cv.cs.ritsumei.ac.jp

***********************************





More information about the vtkusers mailing list