Hi there,
I'm building a Win32 application.
I'd like to build a WPF dll that catches/renders the Win32 app's framebuffer?
What do you think about? is it possible or not? if yes how can I do it?
Thanks,
Carmelo.
-
-
So you want to interrupt GDI and render it with WPF instead? I'm confused.
-
Yes, you've understood.spivonious said:So you want to interrupt GDI and render it with WPF instead? I'm confused.
My issue in details is:
- 1 - I'd like to catch the frame buffer from my Win32 application.
- 2 - I'd like to catch also the frame buffer from WPF dll.
- 3 - So when I have these buffers I'll be able to blend them.
At high level I think is not too hard... But in order I could do that at code level maybe is not too easy.
-
I just have to ask why do you want to do this?Viashivan said:
Yes, you've understood.spivonious said:*snip*
My issue in details is:
- 1 - I'd like to catch the frame buffer from my Win32 application.
- 2 - I'd like to catch also the frame buffer from WPF dll.
- 3 - So when I have these buffers I'll be able to blend them.
At high level I think is not too hard... But in order I could do that at code level maybe is not too easy. -
Because I'd like to blend the Win32's frame buffer with WPF's frame buffer.spivonious said:So you want to interrupt GDI and render it with WPF instead? I'm confused.
So with DirectX I can catch the buffer from my Win32 app, but with my WPF dll I don't know how to do it...
-
I'm still learning WPF, but WPF is built on DirectX, so I imagine there has to be a way to intercept the framebuffer before it's rendered to the screen.Viashivan said:
Because I'd like to blend the Win32's frame buffer with WPF's frame buffer.spivonious said:*snip*
So with DirectX I can catch the buffer from my Win32 app, but with my WPF dll I don't know how to do it... -
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspxViashivan said:
Because I'd like to blend the Win32's frame buffer with WPF's frame buffer.spivonious said:*snip*
So with DirectX I can catch the buffer from my Win32 app, but with my WPF dll I don't know how to do it... -
Viashivan said:
Because I'd like to blend the Win32's frame buffer with WPF's frame buffer.spivonious said:*snip*
So with DirectX I can catch the buffer from my Win32 app, but with my WPF dll I don't know how to do it...it might be possible but that sounds very very ugly in so many ways.... I really wonder what it is that you want to have in the end?
are you wanting the Win32 app to have a screen that has things that are drawn by WPF ??if so you could host a WPF controll inside a WIn32 form and that would be much simpler and cleaner to do.
what tech is showing the screen, WIn32/GDI or Win32/WPF?
you can host GDI controls in a WPF form
or
you can host WPF controls in a GDI form
each of them will work and not need you to hack up framebuffer captures.
also I think that grabbing framebuffers could be difficult for new versions of windows later, the app might not work.
also it might have some probems with the DirectX stack installed on a given users pc and / or with the hardware they have ....
I can see a lot of ways this could be very unstable and buggy on some users pc's
too many details that could break... may not be a big deal today for a small number of users but.... -
Also, your post title says Direct3D, but your posts say Win32. Which is it? The former could be considered a subset of the later, but you also confirmed you want to intercept GDI, which has little to do with Direct3D.
Also, you keep talking about this "WPF dll". Does it display something on screen using Interop, or is it just rendering to an internal memory buffer that you want to do other things with?
And just to throw another variable onto the stack, perhaps D3DImage from .Net 3.5 SP1 will help accomplish what you are really trying to do.
http://msdn.microsoft.com/en-us/library/system.windows.interop.d3dimage.aspx -
the OP says he wants to "Blend" them so it sounds kind of like he wants to "composit" them, sounds kind of like he wants a window that has some kind of visual effect that he needs to do from WPF onto a Forms/GDI window.DCMonkey said:Also, your post title says Direct3D, but your posts say Win32. Which is it? The former could be considered a subset of the later, but you also confirmed you want to intercept GDI, which has little to do with Direct3D.
Also, you keep talking about this "WPF dll". Does it display something on screen using Interop, or is it just rendering to an internal memory buffer that you want to do other things with?
And just to throw another variable onto the stack, perhaps D3DImage from .Net 3.5 SP1 will help accomplish what you are really trying to do.
http://msdn.microsoft.com/en-us/library/system.windows.interop.d3dimage.aspx
if so he is ither confused or a genius... not sure which till he explains the deseried result and how it would be used. -
Thanks guys,
maybe I had not a clear scenario of what I wanted... sorry!
Now I think the key for to do what I want is D3DImage class.
So I have to create a D3DContent like a dll and after that I have to host it in a WPF application.
I tried to build a WPF application and insert the D3DContent dll made before ( http://msdn.microsoft.com/en-us/library/cc656716.aspx and http://msdn.microsoft.com/en-us/library/cc656785.aspx).
Now I can handle the D3DImage's frame buffer like a picture in my WPF app.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.