Login
 
Archive
Links
Search
Blog List
There are no categories in this blog.
 
May 24

Written by: Jeremiah Morrill
5/24/2007 5:15 AM

I have been tinkering around more with the concept of bringing regular Winform/Win32 controls into the WPF compositing airspace.  It's not too hard to get the actual Win32 control visual into WPF, the hard part is making it interactive too.

After a few failed attempts, I remembered how the WPF 3D team was able make 2D WPF controls maintain interactivity while on a 3D surface.  Using the same general idea, I was able to make a working prototype.  After killing a couple memory leaks and using the native bitmap code I slapped up, I was able to get pretty decent performance.

Here is a screenshot of my prototype.  I added reflection as visual WPF "proof" :).

The video of this is below.  The FPS looks choppy because of WM9 encoding kills the CPU, but I promise it was smooth and creamy as butter here locally.

Win32/WPF Interop

Video capture of Win32/WPF compositing

(Its a zip file because my IIS needs to be configed for WMV MIME)

Tags:

4 comments so far...

Re: Composited, Interactive Win32 Controls in WPF

You left a ':' out of your link, but I managed to get the file. That's awesome ... I don't know of anyone who is bending WPF to the degree that you are. Keep it up!

-Eric

By Eric Meyer on   5/24/2007 6:45 AM

Re: Composited, Interactive Win32 Controls in WPF

I'm only just getting into WPF, but that looks pretty good. Care to post/analyze your approach?

By Randolpho on   5/24/2007 6:50 AM

Re: Composited, Interactive Win32 Controls in WPF

Thanks guys.

I'll try and get this cleaned up enough this weekend and I'll give out the code. It really needs a lot of work to make it a seemless integration into WPF.

To make this as efficient at possible, I need to find out how to detect when a Win32 window is dirty and re-render the Win32 to WPF. Right now I am blindly rendering the Win32 at a predefined interval (frames-per-sec). Right now, 30 renders per second on a 500x500 pixel control does about 15% CPU on my box.

By JMoney on   5/24/2007 10:54 PM

Re: Composited, Interactive Win32 Controls in WPF

Im glad your shot did not include rosie

By hv3 on   5/25/2007 9:54 AM

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment    Cancel  
  Minimize
Text/HTML Minimize
Copyright 2007
Downloaded from DNNSkins.com