Solved

Dos Bitmaps in Borlannd 5.0

Posted on 1997-04-16
3
206 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 how to clear a vector as well as how to detect empty vectors in C++.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now