0

I want to load an int string, which consists of width × height elements, which represents a 32-bit RGB value into a Pixmap in Xlib.

I've just found XReadBitmapFile(), which can read from a X Bitmap to X Pixmap, and this might not really meets my needs.

So, should I design a new function to process it? Any hints are appreciated.

Kevin Dong
  • 5,001
  • 9
  • 29
  • 62

1 Answers1

-1
void drawString::DrawString(Display *d, Drawable win, XFontStruct *fontType, int rectWidth, int rectHeight, int HAlign, int VAlign, char* fmt, unsigned long color, unsigned long textColor, Pixmap bgPixmap)
{
    GC gc;

    if( initValues->blnExitUITThread )
        return;

    if( fontType == NULL )
        return;

    unsigned short fontHeight, fontWidth, singleFontHeight;
    int x, y;
    Pixmap pixmap;
    char* token;

    initValues->trueColor = textColor;

    pixmap = XCreatePixmap(d, win, rectWidth, rectHeight, DefaultDepth(d, 0));
    gc = XCreateGC(d, pixmap, 0, NULL);
Artem Mostyaev
  • 3,874
  • 10
  • 53
  • 60
  • Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, **can you [edit] your answer to include an explanation of what you're doing** and why you believe it is the best approach? – Jeremy Caney Dec 26 '21 at 09:06