|
Author: |
Jeremiah Morrill |
Created: |
5/19/2007 6:33 PM |
 |
Anything software/technology related |
By Jeremiah Morrill on
10/22/2007 3:28 AM
If you've messed with the DWM API for Vista you'll have already realized that it kinda sucks. There's only an API for creating live 2D thumbnails on hWnds. The DWM actually renders all Windows to Direct3D textures. If we had access to these textures, we'd be able to do some pretty wicked things with the desktop. Sadly these API calls are locked away from us and we can only gaze upon what Vista "could have been" via Flip3D. I have been trying to hack away at the DWM API(dwmapi.dll) and I believe I have made some progress. I am able to get the Direct3D texture for and hWnd and use it within a Direct3D application. The problem is I seem to only be able to get hWnds that are using 3D, so GDI redirected windows render black. Here is a video of my progress. It's not anything visually jaw dropping, but it shows one application rendering another application as a texture on a 3D surface...all through DWM! Video linked below. DWM Hack Video
Read More »
|
By Jeremiah Morrill on
10/20/2007 5:07 AM
There have been too many Vista vs. OSX articles, in which almost all have been from a consumer perspective. I'm a software developer, so I generally don't care how cool iPhoto is or want to get in a religious war of iTunes vs. Windows Media Player. What I do want to talk about is UI. More specifically, Vista DWM vs. OSX Quartz Compositor/Apple Core. OSX Introduction I recently had my employer purchase me a Mac Pro. It was a win/win situation because I can dual boot my Windows OS with OSX and at no risk because it wasn't my money. I have not really used a Macintosh since 1999. I believe System 9.5 was the last one I used. See, I was a double major, computer science and computer graphics. For computer graphics we had the Macintoshes. That is where I learned to hate anything Apple made. Not a single Mac could run Photoshop for more than 25 minutes without crashing (when I say crash I'm talking "sad mac" face) and the entire class would constantly request to "finish their work" in the CAD room
Read More »
|
By Jeremiah Morrill on
8/6/2007 3:41 PM
I found a nice algorithm online for rendering water effects. I thought this would be a good way to put the BitmapSource pixel buffer trick to work. I've posted the executable and will post the source code when it's a little more cleaned up. Click and drag on the image after you run it. watereffect.zip
Read More »
|
By Jeremiah Morrill on
8/1/2007 7:36 AM
Leslie busted some ass cleaning up the code for the WPF Win32 Renderer and its looking mighty nice. We now have a project on CodePlex if anyone wanted to download the code. It is buggy and will eat up some CPU...and lacks some comments, but hey, its our first release :) http://www.codeplex.com/WPFWin32Renderer -Jer
Read More »
|
By Jeremiah Morrill on
7/24/2007 4:48 AM
Recently, Leslie, a very talented programmer had show some interest in some of these nasty hacks I have up here. The BitmapSource pixel pointer hack and the Composited Win32 Control in WPF. Leslie has taken this to the next level and has produced an interactive Win32 control composited on WPF 3D! If anyone has looked at my older solution, I took the easy route and just put an always-on-top Winform over the WPF area to get interactivity. Leslie took the time to redirect win32 messages to make for more seemless integration. We have talked briefly about the possibility of starting a codeplex project. I am very excited about what Leslie has accomplished and can not wait to work on it too!
Read More »
|
By Jeremiah Morrill on
7/9/2007 2:05 AM
I've taken a short sabbatical on blogging as the nine-to-fiver has been crackin the whip. I should have some cool ish comming up soon! In the mean time, I have added a forum section to chat about anything programming or WPF related. Feel free to give information or ask questions or even ridicule me on the hacks in this blog =).
-Jer
|
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 »
|
|
|
|