Best/simple way to display and change images? - Motif

This is a discussion on Best/simple way to display and change images? - Motif ; Does anyone know of simple example for loading jpeg image (probably with ijg libjpeg) and/or a png image (via libpng) to a motif window and then changing these images later? I am learning motif and am going to try to ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Best/simple way to display and change images?

  1. Best/simple way to display and change images?

    Does anyone know of simple example for loading jpeg image (probably
    with ijg libjpeg) and/or a png image (via libpng) to a motif window and
    then changing these images later?

    I am learning motif and am going to try to write a simple utility as an
    educational exercise. I think it will have a list widget listing the
    names of our 3 web-servers with some blank space below. Clicking on a
    web-server name will cause the blank space to display a photo of the
    server (jpeg) and the latest associated MRTG graph image (png).
    Clicking on another server name from the list will cause the images to
    change to reflect the newly selected server. The program will fetch
    these images from local disk storage, no networking code.

    I should be able to figure out most of this on my own, but I am at a
    total loss when it comes to loading, displaying, and changing these
    images. Is there some example code of how to do this that I could look
    at?

    Thank you for help!


  2. Re: Best/simple way to display and change images?

    woodenbicycle@hotmail.com wrote:
    > Does anyone know of simple example for loading jpeg image (probably
    > with ijg libjpeg) and/or a png image (via libpng) to a motif window and
    > then changing these images later?
    >
    > I am learning motif and am going to try to write a simple utility as an
    > educational exercise. I think it will have a list widget listing the
    > names of our 3 web-servers with some blank space below. Clicking on a
    > web-server name will cause the blank space to display a photo of the
    > server (jpeg) and the latest associated MRTG graph image (png).
    > Clicking on another server name from the list will cause the images to
    > change to reflect the newly selected server. The program will fetch
    > these images from local disk storage, no networking code.
    >
    > I should be able to figure out most of this on my own, but I am at a
    > total loss when it comes to loading, displaying, and changing these
    > images. Is there some example code of how to do this that I could look
    > at?
    >
    > Thank you for help!
    >


    Have a look at subjects 136 through 142 of the Motif FAQ:

    http://www.rahul.net/kenton/faqs/Motif-FAQ.html

  3. Re: Best/simple way to display and change images?

    On 6 Dec 2005, woodenbicycle@hotmail.com wrote:

    > Does anyone know of simple example for loading jpeg image (probably
    > with ijg libjpeg) and/or a png image (via libpng) to a motif window
    > and then changing these images later?


    For static images, the FAQ suggestion might be good. You can also
    look at the xtiff source in the libtiff contributions. Libtiff,
    libjpeg, and libpng (as well as netpbm) are some Open source libraries
    for image manipulation.

    You will have to form a X-pixel mapping from whatever the color
    mapping of the file format library is. For instance, libtiff will
    read the tiff files via scan lines in a pixel depth of the tiff image.

    You must convert the TIFF pixel to a pixel in the X visual used by
    your application. The difficult part comes in getting a visual that
    is suitable for displaying pictures.

    hth,
    Bill Pringlemeir.

    --
    Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral. - Freire

  4. Re: Best/simple way to display and change images?

    woodenbicycle@hotmail.com wrote:
    > Does anyone know of simple example for loading jpeg image (probably
    > with ijg libjpeg) and/or a png image (via libpng) to a motif window and
    > then changing these images later?


    Now that OpenMotif 2.3 beta supports JPEG and PNG natively,
    you can set such an image simply as a resource, just as
    you would for a pixmap in .xbm format.
    You can do this from a static resource file, which is interpreted
    at program startup, or from your code once the program is
    already running.
    Any widget that accepts XmNpixmap as a resource should be able
    to load in your JPEG or PNG image.

    But you need OpenMotif 2.3
    http://www.openmotif.org/

    Best regards,

    Dušan Peterc
    http://www.arahne.si

+ Reply to Thread