I think I found how to show the image.And it can run on console
#include <dos.h>#include <conio.h>// Global Variablesint OldMode; // variable to save user''s original modeunsigned char far *VgaScreen; // variable to point to screen// Function Declarationsvoid OpenGraph();void CloseGraph();// Main Programvoid main(){ OpenGraph(); // open graphics mode 0x13 *VgaScreen = 1; // display a blue dot getch(); // wait for a keypress CloseGraph(); // back to user''s original mode}////////////////////////////////////////////////////// OPENGRAPH //// Gets into graphics mode 0x13 (320x200x256) //////////////////////////////////////////////////////void OpenGraph(){ union REGS regs; VgaScreen = MK_FP(0xA000, 0x0000); // set pointer to screen address OldMode = peekb(0x0040, 0x0049); // save user''s video mode first regs.h.ah = 0x00; // service 0, Set Video Mode regs.h.al = 0x13; // set graphics mode to 320x200x256 int86(0x10, ®s, ®s); // execute BIOS call}////////////////////////////////////////////////////// CLOSEGRAPH //// Restores user''s original video mode //////////////////////////////////////////////////////void CloseGraph(){ union REGS regs; regs.h.ah = 0x00; // service 0, Set Video Mode regs.h.al = OldMode; // set graphics mode back to user''s int86(0x10, ®s, ®s); // execute BIOS call}
Thanks for your help...