• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Dos Bitmaps in Borlannd 5.0

How do I get a bitmap displayed on a dos target using Borland 5.0?
0
dpierce
Asked:
dpierce
  • 2
1 Solution
 
LucHoltkampCommented:
This is not an easy question!
In DOS you have to do everything yourself. There is no support in Borland 5.0 to display a bitmap on the screen in a DOS platform.
Even worse:
* Borland's graphics pack only supports graphic cards up to the
  standard VGA (480x640 16 color).
* There is now support for graphicfiles. You have to readin and
  decode the graphicfile on your own. One specific problem is
  that DOS works with segmented memory. So you can't readin a
  bitmap in one contiguous piece of memory if it's larger than
  64k
* if you want to do it fast and efficient, you have to write
  directly into the memory of the graphiccard. This is tricky
  because many card use special interleaved memory (EGA) or it's
  memory is only accesable in small chuncks (SVGA). Also will it
  be hard to mix your routines with standard Borland graphics, so
  you have to do all the graphic card initialisation etc. on your
  own. (For all graphic cards on the market)

A simple way to do it (slow and clumsy):
0) use the borland graphics library to initialize the screen
1) while not ready
1.1) readin 64k from the bitmap (from file).
1.2) use the 'putpixel' function to set the pixels on screen,
     corresponding to the bitmap pixels.

Finally:
It's probably easier to learn programming Windows and use it's excelent graphics and bitmaphandling, then to try displaying a bitmap in DOS.

0
 
dpierceAuthor Commented:
Please clarify how I can do it slow and clumsy.  The target that I am working with has a 480x640 LCD Display, But I am using it rotated 90 degrees.  I am currently using the BGI commands for setting the text.  Are you saying that I can just use the put pixel command?  Using a HEX editor I viewed the bitmap image and noticed that the first two bytes are BM.  If I were to read this into memory is there information on the format this is in?  Can you please reply.  Thank you.
0
 
LucHoltkampCommented:
Can you tell me a little bit more about what exacly you are trying to do. If I read your comment I assume you try to display a bitmap in a file. What type is it? (*.bmp, *.gif, *.tif, ...)
Every filetype has a header wich describes the format the bitmap is saved in. (i.e. number of bits per pixel, compression, etc).


0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now