Rotate DWM Thumbnails - wpf

I was successfully able to register a DWM thumbnail and display it in my window (what I mean is the Vista/Win7 feature which allows you to live stream other top-level windows inside yours). Is there any way to rotate the thumbnail in my window? I Use WPF 3.5 SP1.

Try RotateTransform

So it seems it is currently not possible:
It has basically the same restrictions as hosting Windows Forms: no visual brush, airspace issues, only uniform scale transforms will work correctlly.
Let's just hope Microsoft will add support for more transforms in Windows 8.

Related

WPF Windowstyle None + Create DropShadow using Native Windows API

I want to create a borderless Window via Windowstyle=None, but still want the default OS DropShadow effect.
I do NOT want to draw the border myself because i do NOT want to set AllowTransparency=True (the application runs on low end systems where this causes very bad performance of the application).
I do also NOT want to use third party Dlls that generate a "Shell" for me.
So what is want is to call the OS native API to draw its default border for me. I tried out this answer here DropShadow for WPF Borderless Window but this didnt work for window 8.
Any suggestions would be helpful.
Thanks
Edit: Using .NET 4.0 and the solution should support Windows 7 and Windows 8
There is no native drop shadow in Windows 8. You can call the API but it won't do anything.
Metro flat design doesn't have drop shadow, unlike the glossy Vista and W7.
AFAIK without AllowsTransparency="True" you won't have that effect.

Blend 5 (preview) missing Platform/resolution tab for WPF?

Developing a WPF-application in Expression Blend for Visual Studio, I read that Blend now has the ability to emulate different resolution/dpi and orientations: http://blogs.msdn.com/b/b8/archive/2012/03/21/scaling-to-different-screens.aspx
However, I can't seem to find the PlatformTab they mention:
Does it not apply to WPF? I'm developing for an 10-inch Windows 8-tablet, but don't have access to the actual device yet. And I'm not sure I get the sizes correct.
Are there alternatives for WPF?
The platform pane is only available for HTML and XAML Windows Store apps.

Transparent window above OpenGL

My application have OpenGL Engine in a WPF hosted Window.
I created half-transparent widget (as Window object) that should display content above OpenGL window. Sometimes when application processing data, widgets backgrounds becomes black (see attached image).
Does anybody know what it is. How can I resolve this problem.
Since Vista Windows supports a new PIXELFORMATDESCRIPTOR flag: PFD_SUPPORT_COMPOSITION. If this flag is set, the OpenGL context creates will integrate into the desktop composition system:
http://msdn.microsoft.com/en-us/library/cc231189(v=prot.10).aspx
It's not guaranteed to work at all. OpenGL windows are not composited with WPF transparency, either below or above. It may work sometimes, but it doesn't have to.

Why do I see pixels when zooming WPF application in Windows?

I have developed a GUI for a random application using WPF. I have a bunch of out of box WPF controls laid on the application window. I haven't customized anything, didn't use bitmaps, etc.
When running my application and zooming using Magnifier application in Windows 7 (Win key + Plus key, the magnified GUI is showing pixels.I am probably wrong, because I can't explain it otherwise, but isn't WPF supposed to provide vector like control rendering?
Thanks for participating in the discussion.
Bonus Reading
Tim Sneath: Magnifier: An Interesting Discovery (archive)
WPF Vector based interface *(screenshot of WPF being vector scaled by Magnifier)
MSDN Blogs: Greg Schechter explains why it longer happens (archive)
Back when Vista first shipped, and when WPF was on version 3.0, zooming with the built-in magnifier would actually do vector-based scaling.
This stopped working when WPF 3.5 service pack 1 shipped. (It worked in 3.5 before sp1.) The reason it worked before then is that the DWM (Desktop Window Manager) - the part of Windows responsible for presenting everything you see on screen - uses MILCORE.DLL to do its rendering. Version 3.0 and 3.5 of WPF also used this same component to render - this meant that all WPF content was native content, so to speak. (In fact, on Windows XP, which doesn't have the DWM, MILCORE.DLL is something that WPF puts on your system for its own benefit. But it's built into Vista and Windows 7.) When WPF was using MILCORE.DLL to render on Vista, any effects applied by the DWM such as scaling would also apply in the way you want to WPF - it really did scale without pixelating.
Unfortunately, this is no longer the case. And the reason is that WPF started adding new rendering features. In 3.5 sp1, the new feature in question was support for custom pixel shaders. To enable that, Microsoft had to release an update to the MIL. (The Media Integration Layer - the bit that does the actual rendering.) However, they weren't really in a position to update MILCORE.DLL, because that's part of Windows - it's how everything you see on screen gets to be on screen. Releasing a new version of MILCORE.DLL effectively means pushing out an update to Windows. The release schedule for Windows is independent of that for .NET, and so the only way the WPF team could reasonably add new features was to ship a new MIL. (In theory they could have done it via Windows Update, but since WPF is now owned by a different division of Microsoft than Windows, that sort of thing doesn't seem to happen in practice.)
As of .NET 3.5 sp1, the MIL is in a different DLL called wpf_gfx_vXXXX.dll where vXXXX is the version number. In .NET 4.0, it's wpf_gfx_v0400.dll.
The upside is that WPF gets to add new rendering features with each new version, without needing Windows itself to be updated. The downside is that WPF's rendering is no longer as tightly integrated with Windows as it was briefly back when Vista shipped. And the upshot is, as you've seen, that magnifying is not as much fun as it used to be.
The magnifier application implements its own zoomed image rendering, so that's why you are seeing pixels. WPF does use vector graphics, but in this situation it's not the WPF application itself that is rendering the zoomed image.
If you use something like Snoop you can see zoomed and scaled WPF vector graphics rendering in action.
I suppose, Windows 7 magnifier takes a snapshot of actual application on-screen UI, and then magnifies it itself (not making a special case for WPF applications). Of course what it can access is just the pixels, not the vector graphics which works behind the scene.
The Windows-7-Magnifier is pixel based, but there is a difference in magnifier mode depending on wether an Aero-theme is active or not.
with Areo theme the zoom is pixelated.
without Areo theme the zoom is smoothed (blurry).
Only with Areo theme other Views (except "Docked") are selectable.

Is there a secret trick to force antialiasing inside Viewport3D in Windows XP?

Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolution the experience is so bad that it can not be used in production code.
I have managed to force antialiasing on some Nvidia graphics cards using the settings of the driver. Unfortunately, this sometimes yields ugly artifacts and only works with specific cards and driver versions. The official word from Microsoft on this regard is that antialiased 3D is generally not supported under Windows XP and the artifact I see result from the fact that WPF already does its own antialiasing (on XP only for 2D).
So I was wondering if there is maybe some other secret trick that lets me force antialiasing on WPF 3D content under Windows XP.
Have you tried this (from your thread on MSDN forums)?
Well, it seems the reference in the MSDN link above incorrectly specify the affected registry root key. In MSDN it is specified as HKEY_CURRENT_USER, while the correct root key should be HKEY_LOCAL_MACHINE. I've tried setting up the HKEY_LOCAL_MACHINE\Software\Microsoft\Avalon.Graphics\MaxMultiplesampleType to '4' and I can get antialiasing for my WPF Application on XP.
The feeling I get from Matthew MacDonald's Pro WPF Windows Presentation Foundation in .NET 3.0 is that it's not possible:
There's one exception to WPF's software support. Due to poor driver support, WPF only performs antialiasing for 3-D drawings if you're running your application on Windows Vista (and you have a native Windows Vista driver for your video card).
I've never seen anything to suggest that you can enable AA in WPF 3D on anything but Vista, but if there is a way it's new to me and I'd love to know as well!
Does your video card support Shader 2.0? You can refer to this wiki page to see if it does...

Resources