# how to get vtkImageViewer2 PlaneAxes differently and convert output image to bitmap or bitmapsource

**URL:** https://discourse.vtk.org/t/how-to-get-vtkimageviewer2-planeaxes-differently-and-convert-output-image-to-bitmap-or-bitmapsource/6992
**Category:** Support
**Created:** [October 27, 2021, 1:35pm UTC](https://discourse.vtk.org/t/how-to-get-vtkimageviewer2-planeaxes-differently-and-convert-output-image-to-bitmap-or-bitmapsource/6992 "2021-10-27T13:35:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Javad\_Hosseini](https://discourse.vtk.org/user_avatar/discourse.vtk.org/javad_hosseini/32/4127_2.png) [@Javad\_Hosseini](https://discourse.vtk.org/u/Javad_Hosseini)
#### Post date: [October 27, 2021, 1:35pm UTC](https://discourse.vtk.org/t/how-to-get-vtkimageviewer2-planeaxes-differently-and-convert-output-image-to-bitmap-or-bitmapsource/6992/1 "2021-10-27T13:35:45Z")

</div>

what im trying to do is a way to get image produced by vtkImageViewer and process on it.

i have done this so far but it seems not working:  
vtkImageData data = \_viewer.GetInput();  
Bitmap bitmap = data.ToBitmap();

i get this exception when i run the code : Invalid Number of Scalar Components

what do miss? what should i do??
