Click here to Skip to main content
13,762,351 members
Rate this:
 
Please Sign up or sign in to vote.
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 16-Sep-10 1:13am

1 solution

Rate this: bad
 
good
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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.181111.1 | Last Updated 16 Sep 2010
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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