Solved

Dos Bitmaps in Borlannd 5.0

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 169
Starting a function in a c++ application with a TCP command from C# 4 71
Issues with C++ Class 19 81
c++, dynamic object by json 1 24
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

895 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

13 Experts available now in Live!

Get 1:1 Help Now