[vtkusers] A Problem About VTK & MFC

JohnMark zhaojunxp at hotmail.com
Thu Oct 11 08:22:49 EDT 2007


Hi , vtk users , 
 
    I meet a delicate problem when I write program to show a image , I use 
vtkDICOMImageReader ,vtkImageViewer2 and MFC , but I try use the Picture control in MFC (its base 
class is CFormView) , and I want to make the image shown in the Picture control . unluckily , if I use 
SetDirectoryName() method of vtkDICOMImageReader , I will get a blank Picture control and another 
vtk render window , but the image should be shown in the Picture control ! while I use the SetFileName
() method and set only one image's path , that will be OK , the image is shown in the Picture 
control . however , if I change the SetFileName() method to SetDirectoryName() , what I get is just a 
blank Picture control and a additional vtk render window , here is the image !
    what is more , I have tried another way to do it , I change to use the MFC view (its base class is 
CView) , the result is : if I use SetFileName() of vtkDICOMImageReader and only read one image , it 
will be OK , but if I use SetDirectoryName() , I will get a blank view window and an additional vtk 
render window ! 
    and I have doubted whether my pipeline is wrong , but if I change vtkImageViewer2 to 
vtkImageViewer , all will be OK , but I want to use vtkImageViewer2 , because it allows us to add 
other actor . so , who can tell me how should I use vtkIamgeViewer2 & vtkDICOMImageReader in MFC ? 
 
    thank you with great regards !
    
    Mark
_________________________________________________________________
用 Live Search 搜尽天下资讯!
http://www.live.com/?searchOnly=true
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071011/1a2cf928/attachment.htm>


More information about the vtkusers mailing list