Click here to Skip to main content
13,898,041 members
Rate this:
Please Sign up or sign in to vote.
See more:

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.

Anshu Dutta

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190306.1 | Last Updated 16 Sep 2010
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100