HOW to copy a window's background to a new pixmap - Xwindows

This is a discussion on HOW to copy a window's background to a new pixmap - Xwindows ; Hi any one know how to copy a window's background to a new pixmap? //now i create a approach pixmap of window Pixmap pixmap = ::XCreatePixmap(display, window, width, height, depth); and how to copy the background of the window to ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: HOW to copy a window's background to a new pixmap

  1. HOW to copy a window's background to a new pixmap

    Hi
    any one know how to copy a window's background to a new pixmap?

    //now i create a approach pixmap of window
    Pixmap pixmap = ::XCreatePixmap(display, window, width, height,
    depth);

    and how to copy the background of the window to pixmap?

    thanks in advance


  2. Re: HOW to copy a window's background to a new pixmap

    i've fixed the problem...but i get a new problem

    I set a new window background with the pixmap,

    ::XSetWindowBackgroundPixmap(display, new_window, pixel);
    ::XClearArea(display, new_window, 0,0, width, height, True);

    //size of new_window is larger than window's here, it works~~

    but when a Expose event, the whole background of new_window will be
    full of the pixmap. i don't know why it was normal after XClearArea and
    was wrong after a Expose event?
    how to fix it?


  3. Re: HOW to copy a window's background to a new pixmap


    Jinhao wrote:

    > I set a new window background with the pixmap,
    >
    > ::XSetWindowBackgroundPixmap(display, new_window, pixel);
    > ::XClearArea(display, new_window, 0,0, width, height, True);
    >
    > //size of new_window is larger than window's here, it works~~
    >
    > but when a Expose event, the whole background of new_window will be
    > full of the pixmap. i don't know why it was normal after XClearArea and
    > was wrong after a Expose event?
    > how to fix it?


    I could not understand your question.

    Do you mean you don't want the window background tiled with the
    pixmap after receiving expose events?

    --- Casantos


  4. Re: HOW to copy a window's background to a new pixmap

    Yes,
    If a window background is larger than the pixmap, the window
    background is drew more than one pixmaps tiled after receiving an
    expose event. Is there a feature that has the background drawn one
    pixmap after receiving an expose event?


  5. Re: HOW to copy a window's background to a new pixmap


    Jinhao wrote:
    > Yes,
    > If a window background is larger than the pixmap, the window
    > background is drew more than one pixmaps tiled after receiving an
    > expose event. Is there a feature that has the background drawn one
    > pixmap after receiving an expose event?


    Nope. Your only option would be to catch the ConfigureNotify events
    (they will tell you about the window resizing) and fill the window
    with a new pixmap of the same size.

    --- Casantos


  6. Re: HOW to copy a window's background to a new pixmap


    nojunk@gate.cpmet.ufpel.tche.br 写道:

    > Jinhao wrote:
    > > Yes,
    > > If a window background is larger than the pixmap, the window
    > > background is drew more than one pixmaps tiled after receiving an
    > > expose event. Is there a feature that has the background drawn one
    > > pixmap after receiving an expose event?

    >
    > Nope. Your only option would be to catch the ConfigureNotify events
    > (they will tell you about the window resizing) and fill the window
    > with a new pixmap of the same size.
    >
    > --- Casantos


    Thank you very much
    Jinhao


+ Reply to Thread