SkillAgentSearch skills...

AcrylicWindow

QtWidget uses Acrylic Material to blur windows | Qt 使用亚克力的透明磨砂效果的窗口思路和解决方案 | 跨平台方案

Install / Use

/learn @SunnyCapturer/AcrylicWindow
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AcrylicWindow

Win10 Acrylic(亚克力)、Win11 mica(云母)、Win7 Aero Glass(毛玻璃);也就是通常说的 透明磨砂 效果;

本项目已收录于 Product

<br>

Acrylic Material Document

| OS VERSION | APPELLATION | SDK | EXPLAIN | | ---------- | ------------------------------ | --------------------------------- | ------------------------------------------------------------ | | Windows 7 | Aero Glass / 毛玻璃 / 磨砂玻璃 | extendFrameIntoClientArea() | only Windows 7 / Vista | | Windows 10 | Acrylic Material / 亚克力 材质 | SetWindowCompositionAttribute() | MSDN DOC | | Windows 11 | Mica / 云母 | SetWindowCompositionAttribute() | MSDN DOC |

<br>

Project

  • 『BlurEffect』 属奇思妙想,实现简单且跨平台,属 等效 跨平台透明磨砂效果;**原理: ** 在显示窗口的底层放一个 <u>"QWidget + 图片 + QGraphicsBlurEffect"</u> 作为铺垫
  • 『AcrylicMaterial + Demo』 生成 AcrylicMaterial.dllDemo.exe 调用上面 AcrylicMaterial.dll 的接口,显示一个 QWidget 窗口。**原理: ** 调用 Windows 10/7 SDK 不公开的 API
  • 矩阵逐个点去磨砂
  • qss?
<br>

Show

<img src="./SnapShoot/display.png" width="80%"/> <br> <img src="./SnapShoot/BlurEffect.gif" width="80%"/> <br>

Aero Glass

// 仅支持 windows 7 的毛玻璃 磨砂 透明  Aero Glass 效果
#ifdef Q_OS_WIN
    // 添加 winextras
   #include <QtWin>
    this->setAttribute(Qt::WA_TranslucentBackground);
    QtWin::enableBlurBehindWindow(this);
    QtWin::extendFrameIntoClientArea(this, -1, -1, -1, -1);
#endif
<br>

Note

If the running background images does not load, please check

  • .dll Path
  • Image Path
<br>

Acrylic Material

  1. https://github.com/wangwenx190/Win32Acrylic
  2. https://github.com/Qt-Widgets/qtacrylicmaterial
  3. https://github.com/zhiyiYo/PyQt-Frameless-Window
<br>

Refecnces

  1. 亚克力效果的实现思路 『本项目主要参考此文,后略作修改』
  2. 使用 SetWindowCompositionAttribute 来控制程序的窗口边框和背景
  3. DDE 透明磨砂效果原理: deepin-wm 的动态背景模糊实现
View on GitHub
GitHub Stars40
CategoryDevelopment
Updated12d ago
Forks7

Languages

C++

Security Score

95/100

Audited on Mar 20, 2026

No findings