Hello,
Does anyone have a sample code on how to convert a VTK image to a wxImage or wxBitmap so that it can be displayed in a wxPanel?
I've put together some code to read an image and display it using an "wxVTKRenderWindow" and "vtkImageActor", but it is never scaled right and the 3-D rendering capabilities that come with an Actor are an overkill for me (for now anyway).
What I would like is to simply read the image using VTK functions, convert it to wxImage or wxBitmap and display it in a wxPanel.
Note: I've played around with the vtkImageViewer but I can figure out how to get the image to display inside a wxFrame.
Bob
Hi Bob,
can you not just create an empty wxImage of the correct size and fill in the
RGB values with a
for-loop over each pixel using a pointer starting at wxImage::GetData().
Or even, if you do not want to duplicate the data you could use the wxImage
constructor where you give the data (if it has the right format...)
Please tell me if I'm totally off I'm just trying to get started with
VTK and also I'm more a C++-person.
Sebastian
ยทยทยท
----- Original Message -----
From: "Bob Klimek" <klimek@grc.nasa.gov>
To: <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, October 02, 2002 9:04 AM
Subject: [wxPython] convert VTK to wxImage
Hello,
Does anyone have a sample code on how to convert a VTK image to a wxImage
or wxBitmap so that it can be displayed in a wxPanel?
I've put together some code to read an image and display it using an
"wxVTKRenderWindow" and "vtkImageActor", but it is never scaled right and
the 3-D rendering capabilities that come with an Actor are an overkill for
me (for now anyway).
What I would like is to simply read the image using VTK functions, convert
it to wxImage or wxBitmap and display it in a wxPanel.
Note: I've played around with the vtkImageViewer but I can figure out how
to get the image to display inside a wxFrame.
Bob
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users