[vtkusers] vtkJPEGReader problem

lpf lpf at vico-lab.com
Tue Jul 19 10:41:31 EDT 2005


Hi,
   I am a new guy to VTK. We I display a JPEG file 
with it. It doesn't work. Anybody can tell me what's wrong?

Code:

#include "vtkJPEGReader.h"
#include "vtkImageViewer.h"
#include "vtkRenderWindow.h"

int main( int argc, char *argv[] )
{
 vtkJPEGReader *pReader=vtkJPEGReader::New();
 pReader->SetFileName("E:\\Color.jpg");
 
 vtkImageViewer *viewer=vtkImageViewer::New();
 viewer->SetInput(pReader->GetOutput());
 viewer->Render();
 
 int i;
 for (i = 0; i < 360; ++i)
    {
  viewer->Render();
    }
 
 pReader->Delete();
 viewer->Delete();
 
 return 0;
}


More information about the vtkusers mailing list