For more projects, click here
A 16-bits x86 DOS Assembly library for displaying bitmap files on VGA (320x200, 256 colors) displays.
Note The library was developed and tested using TASM 4.1 and DosBox
See included sample program
Follow these steps:
- You must use the .486 directive at the beginning of the program
.486
IDEAL
MODEL small
STACK 256
- First, include the graph file before your DATASEG section
include "graph.asm" ; Include Bitmap definitions
DATASEG
; Your variables
- Create a bitmap struct in your DATASEG and initialize it with the file path (may include directories)
DATASEG
; This is the Bitmap that we are going to draw. Note how it is initialized
; with the file path (path should be up to BMP_PATH_LENGHTH bytes)
Image Bitmap {ImagePath="img\\b1.bmp"}
- Switch display to VGA mode (see gr_set_video_mode_vga macro in sample program)
- To draw the bitmap use:
; Draw the image
mov si, offset Image
DisplayBmp si, 10,20
where Image is the bitmap struct and the values are x and y coordinates on the screen