nanogui: problem with displaying picture
Subject:
Re: [nanogui] problem with displaying picture
From:
"Greg Haerr" ####@####.####
Date:
4 Oct 2002 21:09:32 -0000
Message-Id: <059501c26be9$88022870$6401a8c0@gregnewport>
> i am using nanox at 640*480*8bpp .. but it doesnt displaye images
> properly at this resolution .. but the same image when viewed using GIMP
> at the same resolution appear all right .. the images are in jpg and bmp
> format .. also earlier i was using 24 bit color and the images were
> coming out right .. i am using tinywidgets to display the picture which
> calls GrLoadImageFromFile() to do the stuff.
When you run in palette mode (8bpp), Microwindows
uses a method where colors are allocated from the
picture's palette to the system palette on a first-come,
first-served basis, starting with the palette index
engine/devopen.c::gr_firstuserpalentry. This needs
to be reset using GdResetPalette() if multiple
images are being displayed.
The draw algorithm is engine/devdraw.c::GdDrawImage(),
which uses GdMakePaletteConversionTable(...MERGEPALETTE).
You might want to change that to LOADPALETTE.
Regards,
Greg