|
Author: |
Jeremiah Morrill |
Created: |
5/19/2007 6:33 PM |
 |
Anything software/technology related |
By Jeremiah Morrill on
5/25/2007 7:01 AM
I have a habit of getting real excited about ish and end up showing off things that are not finished. A handful of people where curious about how I got a win32 control to composite into WPF . I spent a couple hours refactoring the source for some readability. This will make it so you can put any Win32 control into WPF compositing engine. This means reflections, transformations and 3D! More work needs to be done to make it interactive while transformations and 3D are being used. Please remember this is just proof of concept code that was slapped together. I am well aware of all the bugs in it! :). Here's the code to download: Win32 / WPF Composite Prototype - WPFInterop.zip
Read More »
|
By Jeremiah Morrill on
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. Video capture of Win32/WPF compositing (Its a zip file because my IIS needs to be configed for WMV MIME)
Read More »
|
By Jeremiah Morrill on
5/22/2007 5:45 AM
Possible better approach to WPF/Winform Interop? I'm sure if you have done any WPF interop (Winforms in WPF), you might have noticed how easy it is to make it work. But right after you make it work, you quickly find out how difficult it is to make it look and act decent. You probably noticed your archaic WinForms control defies all z-order laws and steals the entire "air space" of your WPF window. It's like a huge, ugly insect splattered on your wind-shield, and you haven't any fluid left to wipe it off. What if I want to texture a Webbrowser control on a WPF 3D Mesh? What if I want to animate and composite my old WinForms control? What if I want my cake and to eat it too? I came up with an obvious solution, so obvious, I'm sure someone out there has thought of it also. What if we were to capture the Winforms content to a bitmap using the WM_PRINT Win32 message (Control.DrawToBitmap() doesn't seem as good). Then take that bitmap and put it on to a WPF Image. For the user to
Read More »
|
By Jeremiah Morrill on
5/20/2007 5:27 PM
Native Pointer to Bitmapsource's Buffer Last post I covered how to get reference to the WPF DirectShow graph and inject your own filter chain. Like I stated, I think this approach is sort of dirty. I say that because it still lacks the control and flexibility needed. So what if we could get direct access a BitmapSource 's native image buffer? You know one exists, though the WPF API hides it (probably for good reason). If we could efficiently update a BitmapSource's buffer, we could do fast image processing (brightness, contrast, hue, etc) or even make our own MediaPlayer in WPF without having to even use DirectShow! Well Friday night, after the bar, I set out with the goal of getting that BitmapSource's buffer. After about six hours and a hangover later, I got what I was looking for. Let me tell you, it was a crash course in Reflection and WIC APIs. Let me give a short explaination on how this is done. WPF uses the unmanaged WIC in the backend for imaging, so it
Read More »
|
By Jeremiah Morrill on
5/19/2007 6:40 PM
This code has now been replaced by v2, called the VideoRendererElement. You can find it here: http://www.codeplex.com/VideoRendererElement
Get Reference to MediaElement's DirectShow Graph and Manipulate it
For the past six or seven months, I have been gorging myself with the Windows Presentation Foundation framework. It's embarrassing, but I have dreams and nightmares about Dependency Properties and one time I swear the dream was vector...
Read More »
|
|
|
|