Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying a bitmap

Status
Not open for further replies.

z99

MIS
Jan 9, 2004
1
0
0
US
anyone know of a good example or information on displaying a bitmap (under dos) in assembly?
 
Hello, if you want to display a bitmap, you need to know
the file format, go to an search engine and search for
"file formats bmp".
You must read the header, then load the bitmap of that file.
The bitmap is flipped, you must turn it.
If it is a 320x200 you can load it to address A000h:0000h
directly, but note that the image is flipped:)
Please note that my example is for bitmaps not compressed.
There are bitmaps compressed in RLE for example.
You need to know how to decompresse it:)
The first time is more difficult, but then it is very simple:)
Keep coding in assembly:)
 
Bitmaps come in many shapes and sizes. The version that Microsoft invented for Windows a LONG time ago (and which is still used today, they are the .BMP files) is totally different from the way bitmaps are actually done by the video system (so now you know why Windows is so %!@$^@ slow).

Basically, the Windows Bitmap file is in a Packed Display format (unlike the old Video Systems which were Planar Display) and they are from left to right, down to up (unlike the video systems which are still left to right, up to down). Of course, the Windows Bitmap file can have from 4 to 16777216 colors, so there's also that problem of putting such a large potential number of colors to a display which probably has 16, 256, 65536, or 16777216.

'course now video systems use the Packed Display format instead of Planar, but still you need to do color matching in case your display has more or less colors than the bitmap file indicates. AND rearrange the data to the proper up-to-down orientation.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top