[vtkusers] How to embed VTK rendering context into Windows Form

Sonya Blade sonyablade2010 at hotmail.com
Wed Jun 11 13:58:04 EDT 2014


Thank you Richard for giving good entry point, with vtkREnderWindow and SetParentId.
My scene scenario is same as yours, I'm not strict on staying in c++, letting all the VTK stuffs to happen at C++ level and copy the content buffer to parent object is fine with me. Frankly speaking, failure of construing the  project is due to the fact of my poor grasp of VC++ template project organization. 
To be specific if I add MyForm.h into PickingArea.cxx example compiler complains about all the things in MyForm.hfile which is not supposed to be:e.g. Error	4	error C2653: 'System' : is not a class or namespace name	D:\...............\ENGINES\VTK_61_BUILD_EXAMPLES\Cxx\Picking\MyForm.h	7	1	AreaPicking
Although it has got nothing to do with VTK I'll appreciate your little push on that.
Regards,

Date: Wed, 11 Jun 2014 13:54:51 +0100
Subject: [vtkusers] How to embed VTK rendering context into Windows Form
From: richard.whitehead at vivosight.com
To: vtkusers at vtk.org; sonyablade2010 at hotmail.com


Sonya,
The main thing to know is that you can get your app working in the "normal" VTK way using a vtkRenderWindow, and then later you can call SetParentId() on the render window, passing a window handle, to get VTK to draw into any window you want rather than into a pop-up window.


Personally I have created my app in C# and have a C++ DLL doing all the VTK stuff, but this requires quite a bit to get started.  MFC is pretty old technology and difficult to get right, but if you want to stay entirely in C++ then you either use MFC or some other framework such as Qt.  It does not matter as far as VTK is concerned, all it takes is a window handle.


Richard
-- 
Richard Whitehead – Senior Imaging Engineer
Michelson Diagnostics Ltd
M: +44 (0)7905 955276   T: +44 (0)20 8308 1695
E: richard.whitehead at vivosight.com   W: www.vivosight.com




Michelson Diagnostics Ltd, 1 Grays Farm Production Village, Grays Farm Road, Orpington, Kent  BR5 3BD, UK
Registered Office: 3 Shearwater, Maidstone, ME16 0DW.     Registered in England No. 5732681
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140611/25ae7c31/attachment.html>


More information about the vtkusers mailing list