nanogui: Problem when drawing an image in a Pixmap (NanoX)


Previous by date: 17 Jan 2003 17:43:04 -0000 Problem when drawing an image in a Pixmap (NanoX), Jacques MOLY
Next by date: 17 Jan 2003 17:43:04 -0000 Re: Win Api diaolg box..., Greg Haerr
Previous in thread: 17 Jan 2003 17:43:04 -0000 Problem when drawing an image in a Pixmap (NanoX), Jacques MOLY
Next in thread:

Subject: Re: [nanogui] Problem when drawing an image in a Pixmap (NanoX)
From: ####@####.####
Date: 17 Jan 2003 17:43:04 -0000
Message-Id: <OF82B1571C.0826EC24-ON80256CB1.005F7736-80256CB1.0060A35F@diamond.philips.com>

Hi,

> In my case it crashes when trying to write to the pixmap

>        myPixmap = GrNewPixmap(si.cols, si.rows, (void *)dummyArea) ;

Try changing the third argument to NULL.  The memory will be allocated by Nano-X.

> Moreover, do you if there are parameters I should change to have a
> better color conversion ?

Are you using a truecolor mode?  In the config file, set SCREEN_PIXTYPE
to the truecolor mode you want.  Also, make sure that SCREEN_E15 is set to N.

Kind regards,

Jon Foster
--

Jacques MOLY ####@####.#### wrote:

Hi,

I'm trying to display images with NanoX.

I use NanoX on top of X11, on a P4 2GHz, with RedHat 8.0.

At first, I simply displayed images with GrDrawImageFromFile, with a
window as first argument.
It works but it's dramatically slow, and the colors are not very good
when displaying a jpeg.

I'm now trying to draw the image to a pixmap (then I'll use GrCopyArea).

Has somebody already done that ? In my case it crashes when trying to
write to the pixmap (seems that that the stack is corrupted).

Do you have an idea ?

Stack & program follow .

Moreover, do you if there are parameters I should change to have a
better color conversion ?

Many thanks,


Jacques.



Program received signal SIGSEGV, Segmentation fault.
0x08065b23 in linear32_drawpixel (psd=0x8199f20, x=615, y=-1358954927,
c=16776176)
    at fblin32.c:39
39                      addr[x + y * psd->linelen] = c;
(gdb) where
#0  0x08065b23 in linear32_drawpixel (psd=0x8199f20, x=615,
y=-1358954927, c=16776176)
    at fblin32.c:39
#1  0x0805279c in GdDrawImage (psd=0x8199f20, x=615, y=431,
pimage=0xbffff7d0)
    at devdraw.c:794
#2  0x08057831 in GdDrawImageToFit (psd=0x8199f20, x=0, y=0, width=640,
height=-1073743920,
    id=-1358954927) at devimage.c:398
#3  0x0805a6eb in GdDrawImageFromFile (psd=0x8199f20, x=135896864,
y=135896864,
    width=135896864, height=135896864, path=0x1 <Address 0x1 out of
bounds>,
    flags=135896864) at devimage.c:217
#4  0x0804d09f in GrDrawImageFromFile (id=3, gc=1000, x=0, y=0,
width=640, height=480,
    path=0x807c9c0 "/home/jacques/Images/eurowards.jpg", flags=0) at
srvfunc.c:2170
#5  0x08049d01 in main (argc=1, argv=0xbffff9d4) at test-pixmap.c:48
#6  0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6





        if (GrOpen() < 0) {
                fprintf(stderr, "cannot open graphics\n");
                exit(1);
        }

        GrGetScreenInfo(&si);

        /* print error, but don't exit*/
        GrSetErrorHandler(errorcatcher);

        myWindow = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, si.cols,
si.rows, 0, WHITE, WHITE);

        myPixmap = GrNewPixmap(si.cols, si.rows, (void *)dummyArea) ;

        GrSelectEvents(myWindow, GR_EVENT_MASK_EXPOSURE);

        GrMapWindow(myWindow);

        myGc = GrNewGC();

        GrDrawImageFromFile(myPixmap, myGc, 0 /* x */, 0 /* y */,
                                            si.cols, si.rows,

"/home/jacques/Images/eurowards.jpg",
                                            0) ;




Previous by date: 17 Jan 2003 17:43:04 -0000 Problem when drawing an image in a Pixmap (NanoX), Jacques MOLY
Next by date: 17 Jan 2003 17:43:04 -0000 Re: Win Api diaolg box..., Greg Haerr
Previous in thread: 17 Jan 2003 17:43:04 -0000 Problem when drawing an image in a Pixmap (NanoX), Jacques MOLY
Next in thread:


Powered by ezmlm-browse 0.20.