I would like to add drop shadows to my thumbnails (I’m using the C implementation) but I cannot use xcompmgr. Is this possible?
Yes, if you edit your colorset for your icons, and use a large value for ‘IconAlpha’ – see the man page for fvwm and FvwmTheme, if you are unsure.
– Thomas Adam
also, you can draw shadows or thomething else with imlib2:
[code] image2 = imlib_create_image(thumbwidth+16, thumbheight+16);
imlib_context_set_image(image2);
imlib_image_set_has_alpha(1);
// edit start: initialize the contents of the image
DATA8 data[256];
memset(data, 0, sizeof(data));
Imlib_Color_Modifier color_modifier = imlib_create_color_modifier();
imlib_context_set_color_modifier(color_modifier);
imlib_set_color_modifier_tables(NULL, NULL, NULL, data);
imlib_apply_color_modifier();
imlib_context_set_color_modifier(NULL);
// edit end
imlib_context_set_color(0, 0, 0, 192);
imlib_image_fill_rectangle(8, 8, thumbwidth, thumbheight);
imlib_image_blur(4);[/code]
[code] image3 = imlib_create_image(256, 256);
imlib_context_set_image(image3);
imlib_image_set_has_alpha(1);
// edit start
DATA8 data[256];
memset(data, 0, sizeof(data));
Imlib_Color_Modifier color_modifier = imlib_create_color_modifier();
imlib_context_set_color_modifier(color_modifier);
imlib_set_color_modifier_tables(NULL, NULL, NULL, data);
imlib_apply_color_modifier();
imlib_context_set_color_modifier(NULL);
// edit end
imlib_context_set_color(0, 0, 64, 192);
ImlibPolygon poly = imlib_polygon_new();
#define AP(x, y) imlib_polygon_add_point(poly, x, y);
AP(126,12); AP(166,69); AP(239,70); AP(204,135); AP(239,189); AP(158,195);
AP(126,245); AP(86,191); AP(12,189); AP(48,126); AP(12,70); AP(93,64);
imlib_image_fill_polygon(poly);
imlib_image_blur(12);[/code]
imlib_blend_image_onto_image(image, 1, 0, 0, thumbwidth, thumbheight, 4, 4, thumbwidth, thumbheight);
imlib_blend_image_onto_image(image, 1, 0, 0, thumbwidth, thumbheight, (256-thumbwidth)/2, (256-thumbheight)/2, thumbwidth, thumbheight);
I know this is a noob question, but where do I put the code? How can I use it?