1、代码
private void ShowPngImage(){vtkPNGReader pngReader = vtkPNGReader.New();pngReader.SetFileName("D:\\图像\\boxes\\cardboard_boxes_01.png");pngReader.Update();vtkImageActor imageActor = vtkImageActor.New();imageActor.SetInputData(pngReader.GetOutput());//imageActor.Update();vtkRenderer render = vtkRenderer.New();render.AddActor(imageActor);render.SetBackground(0.3, 0.9, 0.7);vtkRenderWindow renWin = renderWindowControl.RenderWindow;renWin.AddRenderer(render); // 添加渲染器renWin.Render();}
2、效果