! Move dpg_blur in folder of your project !
Example (decorate=True):
" import dpg_blur"
from dpg_blur import WindowsWindowEffect, get_hwnd
import dearpygui.dearpygui as dpg
dpg.create_context()
" initializing the library "
window_effect = WindowsWindowEffect()
" creating a function that will be executed after the UI is rendered "
def after_init_ui():
" making the background transparent "
window_effect.setAeroEffect(get_hwnd())
" adding a function call after rendering the UI "
dpg.set_frame_callback(20, after_init_ui)
" creating a viewport with a transparent background 'clear_color=[0, 0, 0, 0]' "
dpg.create_viewport(title="Example", clear_color=[0, 0, 0, 0], height=100,width=100)
dpg.setup_dearpygui()
dpg.show_viewport()
while dpg.is_dearpygui_running():
dpg.render_dearpygui_frame()
dpg.destroy_context()
Result:
Example (decorate=False):
" import dpg_blur"
from dpg_blur import WindowsWindowEffect, get_hwnd
import dearpygui.dearpygui as dpg
dpg.create_context()
" initializing the library "
window_effect = WindowsWindowEffect()
" creating a function that will be executed after the UI is rendered "
def after_init_ui():
" making the background transparent "
window_effect.setAeroEffect(get_hwnd())
" make Rounded Corners (for win11) "
window_effect.setRoundedCorners(get_hwnd(), 10)
" adding a function call after rendering the UI "
dpg.set_frame_callback(20, after_init_ui)
" creating a viewport with a transparent background 'clear_color=[0, 0, 0, 0]' "
dpg.create_viewport(title="Example", decorated=False, clear_color=[0, 0, 0, 0], height=100,width=100)
dpg.setup_dearpygui()
dpg.show_viewport()
while dpg.is_dearpygui_running():
dpg.render_dearpygui_frame()
dpg.destroy_context()
Result (with window_effect.setRoundedCorners(get_hwnd(), 10)
):
Result: