Po Lu writes: > "Elijah G." writes: > >> I'm a bit stuck here, i could make to use the stipple bitmap, however it >> doesn't uses background and foreground color from propertized string, >> (and looks very weird). >> >> The drawing works fine, but the problem is trying to get stipple bitmap, >> and makes it work well. >> >> One way that i thought for fix this is redefining bitmap stipple for >> using same string fg and bg colors and bitmap width and height, but for >> this i need the bitmap bits. >> >> I found that image_create_bitmap_from_data also makes stipple bitmap >> (https://git.savannah.gnu.org/cgit/emacs.git/tree/src/image.c#n601); >> i tried to found bitmap bits by using stipple bitmap id but some >> functions/macros are only for X11 (e.g x_bitmap_height and >> x_bitmap_width). >> >> I would be happy to read any advice or feedback. >> >> I've attached to this email a patch for the work that i've done and some >> screenshots for the final results. >> >> Thanks. > > I don't follow your question, but on the assumption that you've run into > difficulties with replacing the background and foreground of the pattern > with those of your choosing, perhaps you must set the "text" and > "background" colors of the DC as suggested by the documentation: > > A brush created by using a monochrome (1 bit per pixel) bitmap has the > text and background colors of the device context to which it is drawn. > Pixels represented by a 0 bit are drawn with the current text color; > pixels represented by a 1 bit are drawn with the current background > color. > > ? Manipulating the stipple bitmap directly should not be necessary, not > with these facilities. Thank you, the stipple implementation now is almost done, now the only problem is that stipple bitmap is not monochromatic, i could test using other monochromatic bitmap and it now works as it should work. I found that it's a problem with this var https://git.savannah.gnu.org/cgit/emacs.git/tree/src/image.c#n604. I'm not sure why and how, i'm trying to figure how to "modify" it (note: i've printed the BITS bitmap with printf and pasted it, and works well, i'm not sure if it can be a posible solution).