Mimicking Acrylic in a Win32 app

Viewed 7147

Microsoft recently announced Acrylic, the glass-like material in Fluent Design. It's presented as XAML / UWP only, but looks very similar to glass, except it can be arbitrarily tinted and can apply in-app to flyover controls as well as to the app's standalone windows.

The 'recipe' makes it appear as though it's implemented in XAML itself, not being exposed to the wider system.

Microsoft's recipe for making acrylic: background, blue, blend, tint, noise

A related SO question confirms this (it's devoid of concrete, technical answers, but implies acrylic isn't available through the WinAPI the way glass is.)

How would someone mimic this in a plain old Win32 app? Using glass, and blending? (Which APIs, and what's possible in Win10 Fall Update's glass APIs that was not in Win7?) If the app was created with Win32 but used a DirectX surface for rendering, would it open more possibilities?

4 Answers

Rafael Rivera posted a small demo app how to use Acrylic Blur in Desktop applications since Windows 10 v1803 (Build 17134.x - RS4 - April 2018 Update)

enter image description here

Basically the enum AccentState has a new entry ACCENT_ENABLE_ACRYLICBLURBEHIND = 4.

In Latest windows 10 device we can combine DWM API and Direct Composition API to recreate the acrylic effect in Win32. In newer Windows we can copy the contents of DWM Thumnail into IDComposition Visual and it can be used to recreate the backdrop for acrylic.

Then the backdrop can be transferred to IDCompositionGaussianBlurEffect to blur the backdrop.

Here is a working Example :Win32 Acrylic Effect

But I highly don't recommend it for production.

Related