<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height: 23.8px;">hello everyone!</div><div style="line-height: 23.8px;"><br></div><div style="line-height: 23.8px;">I have a question about vtkPNGReader.</div><div style="line-height: 23.8px;">I want to show a 2D picture on a qvtkwidget.When I run the project, the vtkOutputWindow shows :</div><div style="line-height: 23.8px;">ERROR:In D:VTK-8.0.1\IO\Image\vtkPNGReader.cxx, line 117</div><div style="line-height: 23.8px;">vtkPNGReader (000001FB05C3F490): Unable to open file 1.png</div><div style="line-height: 23.8px;"><br></div><div style="line-height: 23.8px;">Here it is my code:</div><div style="line-height: 23.8px;"><div>QtGuiApplication3::QtGuiApplication3(QWidget *parent)</div><div><span style="white-space: pre;">       </span>: QMainWindow(parent)</div><div>{</div><div><span style="white-space: pre;">       </span>ui.setupUi(this);</div><div><span style="white-space: pre;">   </span></div><div><span style="white-space: pre;">    </span>vtkRenderWindow* renwin = vtkRenderWindow::New();</div><div><span style="white-space: pre;">   </span>renwin->StereoCapableWindowOn();</div><div><span style="white-space: pre;"> </span>ui.qvtk1->SetRenderWindow(renwin);</div><div><span style="white-space: pre;">       </span>ren1 = vtkRenderer::New();</div><div><span style="white-space: pre;">  </span>ui.qvtk1->GetRenderWindow()->AddRenderer(ren1);</div><div><span style="white-space: pre;">       </span>ui.qvtk1->GetRenderWindow()->Render();</div><div><span style="white-space: pre;">        </span></div><div><span style="white-space: pre;">    </span>vtkPNGReader *reader = vtkPNGReader::New();</div><div><span style="white-space: pre;"> </span>char *filename = "1.png";</div><div><span style="white-space: pre;"> </span>reader->SetFileName(filename);</div><div><span style="white-space: pre;">   </span>reader->Update();</div><div><span style="white-space: pre;">        </span>vtkImageViewer* image_view = vtkImageViewer::New();</div><div><span style="white-space: pre;"> </span>image_view->SetInputConnection(reader->GetOutputPort());</div><div><span style="white-space: pre;">      </span>ui.qvtk1->SetRenderWindow(image_view->GetRenderWindow());</div><div><span style="white-space: pre;">     </span>image_view->SetupInteractor(ui.qvtk1->GetRenderWindow()->GetInteractor());</div><div><span style="white-space: pre;"> </span>image_view->Delete();</div><div><span style="white-space: pre;">    </span>reader->Delete();</div><div><span style="white-space: pre;">        </span>renwin->Delete();</div><div>}</div><div><br></div><div>Do you have any suggertion?</div><div>Thank a lot for the help!</div><div><br></div><div>Best, </div><div>Sheryl</div><div><br></div></div></div><br><br><span title="neteasefooter"><p><br/> </p></span>