Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dos Bitmaps in Borlannd 5.0

Posted on 1997-04-16
3
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
LucHoltkamp earned 100 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

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!

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

610 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