From: Hermang Mansilla (herman_blues@yahoo.com)
Date: Sat 22 Dec 2001 - 16:05:31 IST
Hello Jay, On Thursday 03 January 2002 17:28, Jay Link wrote: > Guess this answers my question: > #define MAXCOLORS 256 > > I wonder if it would still work if you increased that to 16777216? Maybe > some variables would have to be re-defined, but perhaps it could be done > (easily). Maybe it is possible, but I dont think this would be a good idea, because BMPs are bitmaps with a palette with indexed colors, and a big array would be needed to hold a palette with thousands or millions of colors ?. Sometime ago (1993) I copied some samples of 24bit-color-BMPs , and I remember they were very big, after trying to put them as wallpapers in Windows 3.1 the machine started to swap to disk heavily, so I have to remove them as wallpapers, on a 8MB machine at that time :-) More recently I converted some routines for handling 8-bit-color BMPs, unfortunately I lost the Original C code, but I keep the Yabasic source code which I am attaching to this message, It is just plain Basic so it is easy to understand. (If you want to test the code download the Yabasic binary for JAPI from: www.japi.de ) the routines are in the file bmplib.yab the file j.yab is a wrapper for making simple calls to JAPI There are 2 methods for showing the bitmap: one is pixel by pixel with the routine: DisplayImage() which is slow the other method is with a specific built-in routine in JAPI that displays a block of pixels from arrays r() g() b() which is faster hope this helps bye -Hermang P.D. After several hours of porting this routines from C, I read from the JAPI documentation that JAPI had a built-in simple command for displaying BMPs :-( The original routines were oriented to DOS programming and depended on writing directly to the frame buffer using BIOS routines so I removed and rewrote large portions of the routines, maybe I left some variables which are not used, check carefully when porting to C. The file bmplib.yab is a library, but if you use it as the main program then it tries to load a sample bitmap as a Demo. (bathsuit.bmp)
This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST