![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Rendering WPF into DirectX surface/device As I understand it, Direct3D and WPF cannot share the same screen space - however, is there any way of getting WPF to render to a surface that can be overlayed on top of the main Direct3D image, or better still render to the current device buffer? Something like: void render(Direct3D.Device device) { // Call my code to render scene renderScene(device); // Call WPF to render window on top of the scene wpf.renderWindow(device); } |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Rendering WPF into DirectX surface/device I second that request ![]() J "andylarder" <andylarder@discussions.microsoft.com> wrote in message news:F3706CBB-9CA9-4373-9ED1-9DF0A725F375@microsoft.com... > As I understand it, Direct3D and WPF cannot share the same screen space - > however, is there any way of getting WPF to render to a surface that can > be > overlayed on top of the main Direct3D image, or better still render to the > current device buffer? > > Something like: > > void render(Direct3D.Device device) > { > // Call my code to render scene > renderScene(device); > > // Call WPF to render window on top of the scene > wpf.renderWindow(device); > } > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Rendering WPF into DirectX surface/device Unfortunately it's not something we'll be able to support in version 1. I thought there was some discussion on my blog about this, but I'm unable to find it right now. -- -Nick Kramer [MSFT] http://blogs.msdn.com/nickkramer --- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "andylarder" <andylarder@discussions.microsoft.com> wrote in message news:F3706CBB-9CA9-4373-9ED1-9DF0A725F375@microsoft.com... > As I understand it, Direct3D and WPF cannot share the same screen space - > however, is there any way of getting WPF to render to a surface that can > be > overlayed on top of the main Direct3D image, or better still render to the > current device buffer? > > Something like: > > void render(Direct3D.Device device) > { > // Call my code to render scene > renderScene(device); > > // Call WPF to render window on top of the scene > wpf.renderWindow(device); > } > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Rendering WPF into DirectX surface/device From your blog: "The final reason it's important plan is that you can get feedback to Microsoft. I'd like to think WPF is perfect, but it's not -- and we need your feedback to improve it. The nightmare scenario for everyone is your company doesn't look at WPF until the second version, and because we didn't get your feedback, WPF 2.0 is missing that one critical feature you need. Let us know what you need, so we can make WPF the product you want!" This is a critical feature for some of us. Andy. "Nick Kramer [MSFT]" wrote: > Unfortunately it's not something we'll be able to support in version 1. I > thought there was some discussion on my blog about this, but I'm unable to > find it right now. > > -- > -Nick Kramer [MSFT] > http://blogs.msdn.com/nickkramer > > --- > This posting is provided "AS IS" with no warranties, and confers no rights. > Use of included script samples are subject to the terms specified at > http://www.microsoft.com/info/cpyright.htm > > > "andylarder" <andylarder@discussions.microsoft.com> wrote in message > news:F3706CBB-9CA9-4373-9ED1-9DF0A725F375@microsoft.com... > > As I understand it, Direct3D and WPF cannot share the same screen space - > > however, is there any way of getting WPF to render to a surface that can > > be > > overlayed on top of the main Direct3D image, or better still render to the > > current device buffer? > > > > Something like: > > > > void render(Direct3D.Device device) > > { > > // Call my code to render scene > > renderScene(device); > > > > // Call WPF to render window on top of the scene > > wpf.renderWindow(device); > > } > > > > > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | RE: Rendering WPF into DirectX surface/device While not the cleanest solution, there might a work around. You could use a RenderTargetBitmap to render the WPF Visual contents into an offscreen surface, then transfer the contents of that surface into your own DirectX surface. void render(Direct3D.Device device) { // Call my code to render scene renderScene(device); // Call WPF to render window on top of the scene wpfRenderTargetBitmap.Render(myWpfVisualTree); wpfRenderTargetBitmap.CopyPixels(myDirectxLockedPointer); etc. } There would issues with transparency however. Not sure how important that may be for you. "andylarder" wrote: > As I understand it, Direct3D and WPF cannot share the same screen space - > however, is there any way of getting WPF to render to a surface that can be > overlayed on top of the main Direct3D image, or better still render to the > current device buffer? > > Something like: > > void render(Direct3D.Device device) > { > // Call my code to render scene > renderScene(device); > > // Call WPF to render window on top of the scene > wpf.renderWindow(device); > } > |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: Rendering WPF into DirectX surface/device Unfortunately this would also do all the WPF rendering in software not hardware, and as you indicated does not support transparency (though that can probably be dealt with using a pixel shader to render the bitmap). Michael "Radu Margarint [MSFT]" <Radu Margarint [MSFT]@discussions.microsoft.com> wrote in message news:180265DF-6F37-4682-9494-18A73744E159@microsoft.com... > While not the cleanest solution, there might a work around. You could use > a > RenderTargetBitmap to render the WPF Visual contents into an offscreen > surface, then transfer the contents of that surface into your own DirectX > surface. > > void render(Direct3D.Device device) > { > // Call my code to render scene > renderScene(device); > > // Call WPF to render window on top of the scene > wpfRenderTargetBitmap.Render(myWpfVisualTree); > wpfRenderTargetBitmap.CopyPixels(myDirectxLockedPointer); > > etc. > } > > There would issues with transparency however. Not sure how important that > may be for you. > > "andylarder" wrote: > >> As I understand it, Direct3D and WPF cannot share the same screen space - >> however, is there any way of getting WPF to render to a surface that can >> be >> overlayed on top of the main Direct3D image, or better still render to >> the >> current device buffer? >> >> Something like: >> >> void render(Direct3D.Device device) >> { >> // Call my code to render scene >> renderScene(device); >> >> // Call WPF to render window on top of the scene >> wpf.renderWindow(device); >> } >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| directx surface unavailable | Sergio | Vista Games | 1 | 06-20-2008 09:46 AM |
| lost directX device | BonnieT | Vista Games | 9 | 03-30-2007 11:44 AM |
| RE: lost directX device | BonnieT | Vista Games | 0 | 03-27-2007 07:12 PM |
| drawing surface, 2D visual surface as plane in the 3D space | =?Utf-8?B?UnVlZGlnZXI=?= | Avalon | 2 | 07-11-2006 08:38 AM |