I hope there are quicker solutions for these few (as for WPF only, without of using UWP controls and doing XAML-Islands). or draw directly from Direct2D at connected CompositionDrawingSurface). If you want irregular, non rectangular acrylic like rounded corners, you will have to back-draw "pass trough region" image and then mix it with acrylic (Direct2D to draw, SwapChain to push it to Visual layer. Meaning, if you want acrylic behind just one control, you will have to calculate WPF layout, and then change acrylic layout accordingly. You will have to do some custom resizing wizardry depending on your problem.Īlso, you will have to match parent and child layouts manually. Probably, resizing will not be atomic operation, as it will not resize and redraw these two windows as one. In this configuration, problem will be when resizing windows. Still there are more additional problems for this "parent-child" solution: (I have successfully created two transparent WPF windows and set their parent-child relation.) I have not tested this, but, it should work. (set only hwndParent).)Īlso, when ICompositorDesktopInterop.CreateDesktopWindowTarget you should set isTopmost=false to not obstruct child window by Visual Layer. (Or, you can set "acrylic window" as owner of the other. Put "acrylic window" as parent of the other (use Win32 window WS_CHILD & hwndParent properties). If you want to draw usable WPF controls above acrylic, you should try.Ĭreate two windows, one for acrylic and one for WPF controls. Now, I must test this on NET 5 custom project to see if it really works. If this is true, things will get even more complicated if one intents to blur behind WPF tooltip or context menu (WPF popup windows). This is problematic in sense that we must put a window with controls as a child of the window where blur is (swap child and parent, or add new WPF UI-window as top child). Xaml controls, positioned as top, after CompositionHostControl ( like "Button" control shown at images ), are also blurred. It looks like CreateBackdropBrush is fine, I do not use CreateHostBackdropBrush.ĬompositionHostControl, where we blur, is hwnd aning, we have created child window on top of a standard WPF window, and there composition stuff is done. You can see blurred Visual Studio code lines. Where you can see Visual Studio code in the background. at element: WindowStyle="None" AllowsTransparency="True" Background="#440000BB"įor to allow window to become transparent, and add some blueish semitransparent background color.įor composition to see what is behind blocking image. where you can clearly see blurred region. (only added "Button" at top & local:CompositionHostControl back painted reddish semitransparent) This is screenshot of the application before change. I have successfully blurred behind using Visual Layer WPF. Is this even possible.or should I say.is this possible only in UWP!?!? it fails with code: 0x80040154L aka CLASSNOTREG !? GaussianBlurEffect blurEffect => FAILS!!! = 0x80040154L => REGDB_E_CLASSNOTREGīut, on every possible run I just not get past construction of the GaussianBlurEffect struct. h.winmd are in output place.this is like OK) holds effects library where is GaussianBlurEffect is.(done, dll. I have added Win2D.uwp (& later Microsoft.VCRTForwarders.140) NuGet packages.Ĭppwinrt -in lib\uap10.0\ -ref sdk. image of what is behind window!?Ģ) Next, I would apply Gaussian blur effect upon this back host brush.so. where I should, logically, receive fully "transparent" window, aka. Result: What I receive is BLACK sprite visual. Root->Children().InsertAtBottom(m_backVisual) insert at root ContainerVisual, root composition visual M_HostBackdropBrush = m_compositor.CreateHostBackdropBrush() Host Backdrop Brush is brush where compositor will fetch window back image. M_backVisual = m_compositor.CreateSpriteVisual() visual where I will show blurred window back image. host window is created by classic… CreateWindowEx I’m testing this capability on un-managed C++ project that uses WinRT Visual Layer composition classes:ġ) First, this is part of the pseudo code where I don’t blur, but, this shows idea. So, I am trying to blur behind Desktop window using WinRT Visual Layer instead.īut, I’m having problem to blur behind generic Desktop app window (Win32 window or WPF Framework window) using Visual Layer. As you know, DWM Blur behind was turned off starting with Windows 8.ĭOC => DwmEnableBlurBehindWindow => "Beginning with Windows 8, calling this function doesn't result in the blur effect, due to a style change in the way windows are rendered."
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |