diff --git a/src/renderer/image.c b/src/renderer/image.c index a4db5a7..51b4708 100644 --- a/src/renderer/image.c +++ b/src/renderer/image.c @@ -25,11 +25,10 @@ uint32_t *generate_wallpaper(const wallpaper_config_t *wallpaper_config, if (!final_image) return NULL; imlib_context_set_image(final_image); - imlib_image_set_has_alpha(false); + imlib_image_set_has_alpha(true); - /* 填充背景色 */ - imlib_context_set_color(0, 0, 0, 255); - imlib_image_fill_rectangle(0, 0, screen_width, screen_height); + /* 重置像素数据 */ + imlib_image_clear(); const monitor_t *monitor = monitors; uint32_t monitor_index = 0; @@ -118,9 +117,8 @@ uint32_t *generate_icon_pixels(const char *image_path, uint32_t width, Imlib_Image target_img = imlib_create_image(width, height); imlib_context_set_image(target_img); - imlib_image_set_has_alpha(false); - imlib_context_set_color(0, 0, 0, 255); - imlib_image_fill_rectangle(0, 0, width, height); + imlib_image_set_has_alpha(true); + imlib_image_clear(); imlib_blend_image_onto_image(img, 1, src_x, src_y, src_width, src_height, padding, padding, dst_width, dst_height);