Image Replication with X - Xwindows

This is a discussion on Image Replication with X - Xwindows ; I have a question, it can be answered only by you. I have created a window with redcolor in display1, i want to replicate all the things in display1 in display2 by querying the details from display1. I tried using ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Image Replication with X

  1. Image Replication with X

    I have a question, it can be answered only by you.

    I have created a window with redcolor in display1, i want to
    replicate
    all the things in display1 in display2 by querying the details from
    display1.

    I tried using XCreateWindow, XGetImage and XPutImage.

    But the image was completely blurred.

    Please suggest me how to do these things.

    Please reply me as soon as possible.

  2. Re: Image Replication with X

    In comp.windows.x, jeyanthisri@gmail.com

    wrote
    on Wed, 9 Jul 2008 22:43:58 -0700 (PDT)
    <1bee32e6-73e0-4e8a-bb3b-59fa05543faf@a1g2000hsb.googlegroups.com>:
    > I have a question, it can be answered only by you.
    >
    > I have created a window with redcolor in display1, i want to
    > replicate
    > all the things in display1 in display2 by querying the details from
    > display1.
    >
    > I tried using XCreateWindow, XGetImage and XPutImage.
    >
    > But the image was completely blurred.
    >
    > Please suggest me how to do these things.
    >
    > Please reply me as soon as possible.


    There are a number of issues here that have to be carefully
    handled. Since blurring is not an easy distortion (the
    term usually refers to a camera lens that is not properly
    focused) I have no idea what you mean here, but one of
    the following might address your issue.

    [1] One might want to create an image using an XImage
    structure, then, somehow, populate it. This structure
    can be displayed on both displays, though performance
    might suffer under certain conditions on at least one
    of the displays, as the XImage structure is client-side.
    Pixmaps won't work as they're tied to a display, though
    one might try drawing into a display1 Pixmap, then using
    XGetImage on it and XPutImage on display2; if one's doing
    such things as ray-tracing where one has to construct
    things a pixel at a time anyway, one might also look into
    using XPutPixel directly for each pixel, then putting the
    image on both displays.

    You are apparently attempting to use XGetImage/XPutImage,
    so you're halfway there; however, you're apparently
    grabbing the image from a display1 Window instead of a
    display1 Pixmap (both are Drawables). This is fine, *but*
    there are a few other issues in that case.

    [2] Grabbing an image from a Window is possible but one
    has to wait until one's sure the display is constructed.
    Creating a window does not ensure that it is drawn, or
    even visible; one has to wait until one is sure it has
    been mapped (XMapWindow) and drawn into.

    [3] Anything obscuring the display1 Window will also
    be grabbed. (This might be useful, or not.)

    [4] If the display1 Window includes subwindows, the
    subwindows will be grabbed as well. In most cases,
    this is what one wants.

    [5] If the display1 Window has moving parts (an animation,
    such as one might see from Flash), XGetImage may capture
    some strange-looking artifacts if the window just happens
    to be updating at exactly the wrong time.

    [6] If window1 is from an application completely outside
    your control (e.g., you're trying to capture something from
    a Web browser and display it), one might have additional
    issues because of the window manager; XQueryTree on the
    root window will return the display manager's Window as
    opposed to the application's. A XGetImage from the display
    manager's Window will include such things as title bars
    and borders. One can also use XGetImage on the root window,
    in which case one gets the entire desktop.

    [7] On modern PC desktops, colormaps shouldn't be a
    problem (it's all Truecolor), but on older displays (8
    bits or less, mostly, with class Pseudocolor), one might
    have a number of issues as pixels on display2 will not
    have display1's colormap. Even on Truecolor displays,
    if display1 and display2 are different depths (16 and
    32, nowadays) things might get funny looking, leading to
    "falsecolor" images.

    --
    #191, ewill3@earthlink.net
    Q: "Why is my computer doing that?"
    A: "Don't do that and you'll be fine."
    ** Posted from http://www.teranews.com **

  3. Re: Image Replication with X

    On Jul 9, 11:43 pm, jeyanthi...@gmail.com wrote:
    > I have a question, it can be answered only by you.
    >
    > I have created a window with redcolor in display1, i want to
    > replicate
    > all the things in display1 in display2 by querying the details from
    > display1.
    >
    > I tried using XCreateWindow, XGetImage and XPutImage.
    >
    > But the image was completely blurred.


    > Please suggest me how to do these things.


    Well, you should be able to grab a whole image frmo the roow window
    with X(Shm)GetImage, but you seem to have done that.

    Blurring is very odd. Is the monitor running at the native resolution?

    If so, can you capture the blurred image, using some standard tool
    (xwd, for instance), and view that image on the other display? Is it
    still blurred?

    -Ed

  4. Re: Image Replication with X



    *we have created a window with redcolor and some designs in display1,
    we want to
    replicate *all the things from display1 to display2 by querying the
    details from
    *display1.

    We tried using XCreateWindow, XGetImage and XPutImage and
    XCreatePixmap.

    *But the image was completely blurred.

    *Please suggest us how to do these things.




+ Reply to Thread