Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using a Viewport3D control in WPF to diaplay a 3D image in a C# Winform application. I also need to diaplay a 2d Bitmap image behind the scene. My question is - Can I host a 2D bitmap image in a viewport3D control in WPF. Is there any way this can be achieved?

Please help.

Regards,
Anshu Dutta
Posted
Updated 30-Sep-20 3:18am

1 solution

As far as I know there is no general way to add a 2D background to Viewport3D. There is a simple workaround though.

You can use an ordinary Image control to display the background and then place the Viewport3D control right over the image. The underlying bitmap will be visible behind all the models in the scene.
 
Share this answer
 
Comments
anshudutta 16-Sep-10 6:50am    
Thanks! Do you have a code snippet or an example that I can use?
Kubajzz 17-Sep-10 4:23am    
Just create an Image control and a Viewport3D control and put these 2 on the same position.

Something like:

<Image ... />
<Viewport3D ... />

And make sure the Viewport3D control is placed over the Image control. There is nothing more to explain here...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900