Native Aero Blur without Glass Effect on Borderless WPF Window

后端 未结 2 1088
面向向阳花
面向向阳花 2021-01-30 15:07

I am aware that similar questions have been asked and answered. Mine, however, is a three-part question.

For the purposes of this question, keep the following in mind:

2条回答
  •  后悔当初
    2021-01-30 15:53

    1. Applying Aero Glass to Borderless Window

    Since what you are trying to achieve is not so much a glass effect but more of a transparent+blur you can use the following methods to blur behind the window.

    Windows 7: you can use DwmEnableBlurBehindWindow to blur behind the window.

    Window 8: I havn't found a workable solution since DwmEnableBlurBehindWindow was removed in Windows 8.

    Windows 10: you can use SetWindowCompositionAttribute to blur behind the window.

    2. Keeping Native Blur Effect without Glass

    The above solutions will only apply a blur effect behind the window, it will be up to the window to define transparency and colour.

    3. Customizing Blur Radius and Location

    With these approaches you can only blur underneath the entire window, and it will be up to you to use an alpha channel on portions of the window you want to be transparent. I don't think you can define the blur radius either.

提交回复
热议问题