Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Agzes/DPG-Acrylic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

DearPyGui_blur_bg

Micro-plugin to make background blur in DearPyGui on Windows








ɪɴsᴛᴀʟʟɪɴɢ

1 | download dpg_blur.py from releases
2 | put it in the same folder as your main.py
3 | import it in your main.py



ᴇxᴀᴍᴘʟᴇs

↙️ example with decorate ↘️

from dpg_blur import WindowsWindowEffect, get_hwnd
import dearpygui.dearpygui as dpg

# Initialize DearPyGui context
dpg.create_context()

# Initialize the dpg_blur library
window_effect = WindowsWindowEffect()

# Function to apply the aero effect after UI is rendered
def after_init_ui():
    # Make the window background transparent
    window_effect.setAeroEffect(get_hwnd())

# Set function to be called after rendering the UI
dpg.set_frame_callback(5, after_init_ui)

# Create a viewport with transparent background (clear_color=[0, 0, 0, 0])
dpg.create_viewport(title="Example", clear_color=[0, 0, 0, 0], height=100, width=100)

# Setup and display the viewport
dpg.setup_dearpygui()
dpg.show_viewport()

# Run the main loop to keep the UI active
while dpg.is_dearpygui_running():
    dpg.render_dearpygui_frame()

# Destroy the context when finished
dpg.destroy_context()

↘️ example with decorate ↙️

example


↙️ example without decorate ↘️

import dpg_blur
from dpg_blur import WindowsWindowEffect, get_hwnd
import dearpygui.dearpygui as dpg

# Initialize DearPyGui context
dpg.create_context()

# Initialize the Windows window effect library
window_effect = WindowsWindowEffect()

# Function to apply the aero effect and rounded corners after UI is rendered
def after_init_ui():
    # Make the window background transparent
    window_effect.setAeroEffect(get_hwnd())
    # Apply rounded corners for Windows 11 (10px radius)
    window_effect.setRoundedCorners(get_hwnd(), 10) # IF YOU HAVE WINDOWS 10, THEN IT DOESN'T CHANGE ANYTHING.


# Set function to be called after rendering the UI
dpg.set_frame_callback(20, after_init_ui)

# Create a viewport with transparent background and no decoration (clear_color=[0, 0, 0, 0])
dpg.create_viewport(title="Example", decorated=False, clear_color=[0, 0, 0, 0], height=100, width=100)

# Setup and display the viewport
dpg.setup_dearpygui()
dpg.show_viewport()

# Run the main loop to keep the UI active
while dpg.is_dearpygui_running():
    dpg.render_dearpygui_frame()

# Destroy the context when finished
dpg.destroy_context()

↘️ example without decorate [win 11] ↙️

example

---------------------------

example

↗️ example without decorate [win 10] ↖️
or without: 'window_effect.setRoundedCorners(get_hwnd(),10)'





v. 1.1
Made with 💟 by Agzes

About

🧩 • Its micro-plugin to make background blur for viewport in DearPyGui

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages