论文首页哲学论文经济论文法学论文教育论文文学论文历史论文理学论文工学论文医学论文管理论文艺术论文 |
fread( (char *) &header, 1, sizeof(PCXHEAD), fp);
width = header.bytes-perline;
height = header.ymax - header.ymin + 1;
printf("Image information: Width=%d, Height=%d",width,h
eight);
if ((header.bits-perpixel==8)&&(header.color-planes==3)
) {
printf("
Type : 24bits RGB true colors");
printf("1...Emulating display 16M true color image with
64K high color");
printf("2...Display of 16M true color image");
printf("Press select 1 or 2 : ");
if ((c=getch())=='1') {
highcolor();
SetVesaMode(0x03);
}
else if (c=='2') {
truecolor();
SetVesaMode(0x03);
}
else {
printf("This is not high-color & true-color image !")
;
exit(1);
}
}
fclose(fp);
return 0;
}
// 设置VESA BIOS扩展模式函数
void SetVesaMode(unsigned int mode)
{ union REGS r;
unsigned int setmode=1;
r.x.ax=0x4f02;
r.x.bx=mode;
int86(0x10,&r,&r);
if (r.x.ax!=0x4f)
setmode=0;
else VesaInfo(mode);
Curpage=0xffff;
return(setmode);
}
// 返回VESA编程信息函数
void VesaInfo(unsigned int mode)
{ union REGS r;