Solved

Dos Bitmaps in Borlannd 5.0

Posted on 1997-04-16
3
208 Views
Last Modified: 2013-12-03
How do I get a bitmap displayed on a dos target using Borland 5.0?
0
Comment
Question by:dpierce
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
LucHoltkamp earned 50 total points
ID: 1162756
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
 

Author Comment

by:dpierce
ID: 1162757
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
 
LVL 3

Expert Comment

by:LucHoltkamp
ID: 1162758
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question