Acrylic material in win32 application

Microsoft recently unveiled its new "smooth" langauge design, and one part of it is "acrylic" material . This effect makes the element transparent and blurs the background. It can be applied to a window, so that parts of the underlying windows shine (background acrylic) or individual elements in the window, so that other controls shine (in-app acrylic). It is conceptually and visually very similar to vibration on macOS.

It is implemented as a special brush in XAML, but I wonder if there is a way to use it (background acrylic) in a regular Win32 application? The effect looks a lot like the blur applied to the launch menu and taskbar (which is handled by SetWindowCompositionAttribute ), which leads me to believe that it could be activated by a similar flag.

Subquery: I wonder how this is implemented? Is it just a flag that you can set in a window and then apply in DWM (e.g. SetWindowCompositionAttribute or like Aero Glass in Vista and 7)? Or does UWP have some control over DWM and can set up shaders to control their rendering? In Vista, when DWM was first introduced, it had common code with WPF, and it actually shared DirectX-like buffers and scripted scripts, so such tricks were possible. The magifier utility could dramatically increase WPF applications as vector imagesbut this functionality was lost later. The MS method represents the β€œacrylic” on this page (as different layers and is implemented as a XAML brush), it makes me think that you will somehow have to enter layers in the DWM scenario chart, which is difficult or impossible to use from Win32.

+2
source share
2 answers

API- API XAML, UWP XAML Compositor, , , Win32. , , , , . (, Chrome, , Window Chrome , , ).

+2

, WPF: https://github.com/bbougot/AcrylicWPF

, . SetWindowsCompositionAttribute .

+2

Source: https://habr.com/ru/post/1677250/


All Articles