Coder Social home page Coder Social logo

xmuli / acrylicwindow Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 4.0 5.63 MB

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

License: MIT License

CMake 26.60% C 16.89% C++ 55.27% Batchfile 1.24%
acrylic qt

acrylicwindow's Introduction

AcrylicWindow

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


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

Project

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

Show



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

Note

If the running background images does not load, please check

  • .dll Path
  • Image Path

Acrylic Material

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

Refecnces

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

acrylicwindow's People

Contributors

xmuli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

acrylicwindow's Issues

不知道如何編譯

像是QtExamples裡面可以直接運行.pro,然後直接啟動即可,但是這個變成cmake,是直接下cmake CMakeFile.txt編譯嗎,不知道如何啟動@@

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.