Re: XForms: Problem displaying images

T.C. Zhao (tc_zhao@yahoo.com)
Wed, 15 Sep 1999 17:57:11 -0700 (PDT)

# To subscribers of the xforms list from "T.C. Zhao" <tc_zhao@yahoo.com> :

I just looked at the code that parses the color in rgb_db.c
and #rrrrggggbbbb code is there. There may be something
I missed. If the xpm file that is failing is not too big,
can you please send me one ? Maybe I am not striping the
spaces before or after the color properly.

--- Ravi Mehrotra <ravi@csnpl.ren.nic.in> wrote:
> # To subscribers of the xforms list from Ravi Mehrotra
> <ravi@csnpl.ren.nic.in> :
>
> Dear Michael,
>
> I also tried the xpm format. On my machine xpm format does not
> work at all at any depth. I get a blank image and error messages like
>
> .
> .
> In LookupColor [rgb_db.c 210] can't handle color #f8f8fafaffff",
> In LookupColor [rgb_db.c 210] can't handle color #fafaffffffff",
> .
> .
> for many colors. I did use flimage_enable_xpm().
>
> Regards,
>
> Ravi Mehrotra
> National Physical Laboratory
> New Delhi, India.
>
>
> Michael Glickman wrote:
> >
> > # To subscribers of the xforms list from Michael Glickman
> <michaelg@linx.com.au> :
> >
> > Hello, Ravi
> >
> > You didn't tell, how the canvas moves. Do you make it moving
> > programmatically, or it moves as a result of user interaction
> > (dragging the form, etc) ?
> >
> > If canvas moves as the result of your code, I would suggest
> to
> > repeat 'pic->display' and 'XFlush' after move. This may
> help.
> > If the problem appears as the result of user interaction, you
> can
> > trap 'move' event and do 'pic->display' and 'XFlush' in the
> > handler.
> >
> > Actually PPM support is a relatively new feature in XForms,
> > therefore
> > I prefer good old pixmap (XPM) format. It has a number of
> > advantages,
> > e.g. direct X server support, no need for extra libraries, and
> > ability
> > to keep the image as the source code. And, what is more
> important,
> > I don't have any troubles like that. You may argue, that XPM
> > requires
> > more hard disc space then the compressed PPM. But you can
> > compress XPM with gzip and decompress it into a temporary
> file
> > by calling zcat from your program before starting using the
> image.
> >
> > Regards, Michael
> >
> > > -----Original Message-----
> > > From: Ravi Mehrotra [SMTP:ravi@csnpl.ren.nic.in]
> > > Sent: Tuesday, 14 September 1999 17:05 EST
> > > To: xforms@bob.usuhs.mil
> > > Subject: XForms: Problem displaying images
> > >
> > > # To subscribers of the xforms list from Ravi Mehrotra
> > > <ravi@csnpl.ren.nic.in> :
> > >
> > > Hi,
> > >
> > > I am using XForms version 0.89 on a Linux 2.2.6 Pentium II
> machine.
> > > I have a True color image with depth 16. I use the following code
> to
> > > display the image in a canvas.
> > >
> > > void load_cb(FL_OBJECT *ob, long data)
> > > {
> > > FL_IMAGE *pic;
> > >
> > > pic=flimage_alloc();
> > > pic=flimage_load("picture.ppm");
> > > pic->display(pic, FL_ObjWin(canvas));
> > > XFlush(fl_display);
> > > sleep(1);
> > > fl_set_object_position(canvas,canvas->x+50,canvas->y+50);
> > > pic->display(pic, FL_ObjWin(canvas));
> > > XFlush(fl_display);
> > > }
> > >
> > > The picture shows up OK. However, after the canvas is moved, the
> > > picture appears as a faint ghost without color. This happens if I
> > > start my Xserver with depth 16 or 24. The problem disappears if
> > > I start up the Xserver with depth 8 but then I am limited in
> colors.
> > >
> > > Is there a bug or am I doing something wrong ? I will appreciate
> any
> > > help.
> > >
> > > Thanks.
> > >
> > > Ravi Mehrotra
> > > National Physical Laboratory
> > > New Delhi 110012
> > > India
> > > _________________________________________________
> > > To unsubscribe, send the message "unsubscribe" to
> > > xforms-request@bob.usuhs.mil or see
> > > http://bob.usuhs.mil/mailserv/xforms.html
> > > XForms Home Page: http://bragg.phys.uwm.edu/xforms
> > > List Archive: http://bob.usuhs.mil/mailserv/list-archives/
> > _________________________________________________
> > To unsubscribe, send the message "unsubscribe" to
> > xforms-request@bob.usuhs.mil or see
> > http://bob.usuhs.mil/mailserv/xforms.html
> > XForms Home Page: http://bragg.phys.uwm.edu/xforms
> > List Archive: http://bob.usuhs.mil/mailserv/list-archives/
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuhs.mil or see
> http://bob.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuhs.mil/mailserv/list-archives/
>
>

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/