修改 imlib2 重置图片数据方法
This commit is contained in:
@@ -25,11 +25,10 @@ uint32_t *generate_wallpaper(const wallpaper_config_t *wallpaper_config,
|
|||||||
if (!final_image) return NULL;
|
if (!final_image) return NULL;
|
||||||
|
|
||||||
imlib_context_set_image(final_image);
|
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_clear();
|
||||||
imlib_image_fill_rectangle(0, 0, screen_width, screen_height);
|
|
||||||
|
|
||||||
const monitor_t *monitor = monitors;
|
const monitor_t *monitor = monitors;
|
||||||
uint32_t monitor_index = 0;
|
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_Image target_img = imlib_create_image(width, height);
|
||||||
imlib_context_set_image(target_img);
|
imlib_context_set_image(target_img);
|
||||||
imlib_image_set_has_alpha(false);
|
imlib_image_set_has_alpha(true);
|
||||||
imlib_context_set_color(0, 0, 0, 255);
|
imlib_image_clear();
|
||||||
imlib_image_fill_rectangle(0, 0, width, height);
|
|
||||||
|
|
||||||
imlib_blend_image_onto_image(img, 1, src_x, src_y, src_width, src_height,
|
imlib_blend_image_onto_image(img, 1, src_x, src_y, src_width, src_height,
|
||||||
padding, padding, dst_width, dst_height);
|
padding, padding, dst_width, dst_height);
|
||||||
|
|||||||
Reference in New Issue
Block a user