Subject: Re: Chinese Char Programming Tip Needed

From: "Andresen Lab,PC,Physiology" <[email-masked]>
Date: Tue, 13 Sep 1994 13:37:01 -0400

...

<  m using a 24x24 bitmap font for the characters.  I've got an
< algorithm that reads the bitmap from the font file and displays it
< one pixel at a time on the screen.  It works fine for displaying
< individual characters, but to display a screenful of characters takes
< about 15 seconds (even if it is a screenful of the same character
< repeated, eliminating the disk read time!).  Obviously plotting
< characters a pixel at a time is going to be too slow.

< I find that if I plot the entire image at a time (using GetImage and
< PutImage in PASCAL), filling the entire screen with the same character
< takes less than one second--this is clearly the way to go.  The
< problem is, I don't understand how these two procedures store the
< bitmap image.  If I knew that, perhaps I could find some way to
< translate the 24x24 font data directly into this pascal image format,
< load it into memory, and then PutImage it to the screen.  Does any
< body have any ideas?

< I'm using Turbo Pascal 5.5, by the way, and am in hires graphics mode.
< If there is some other technique I am overlooking for getting these
< characters on the screen QUICKLY I would love to hear about it.

< (By the way, each 24x24 character is represented by 72 bytes of data,
< each byte representing eight pixels in a single character row)

< Many thanks for any suggestions you can offer,

< Dave Porter

Dear Dave:

These technique may solve your problem:

1) Put as much bitmap file as you can in RAM. You may even consider 16-bit DOS
   or 32-bit DOS.

2) Do not use something like putpixel to display bitmap on the screen. This
   kind of coocked function is very slow. You need write your bits or bytes
   directly onto video RAM.

3) I do not know Pascal, but in C/C++, there are also something like
   GetImage and PutImage, where getimage loads graphics to RAM and putimage
   copies graphics from memory to video RAM. Thus, PutImage functions fast.

Mingyong Yang
<[email-masked]>