LOADCEPC设置640*480 BMP
来源:互联网 发布:java程序员工作累吗 编辑:程序博客网 时间:2024/04/29 18:32
int fp;
int width,length;
unsigned char * bmp_data;
char far *VideoBufferPtr=( char far *)0xa0000000;
void DrawPoint(int pos,unsigned char color);
void SelectPlane(int page);/*换页函数*/
void Set_640480_Video_Mode();
void put_bmp(char * bmpfile);
void Set_Video_Mode(int mode)
{
union REGS inregs,outregs;
inregs.h.ah=0;
inregs.h.al=(unsigned char)mode;
// BIOS 10H中断初使化视频模式
int86(0x10,&inregs,&outregs);
}
void Set_640480_Video_Mode()
{
__asm
{
mov AX, 4F02h
mov BX, 101h //显示模式 640 * 480 * 256色 ;101h 640 * 480 * 256;103h 800 * 600 * 256
int 10h
}
}
void SelectPlane(int page)
{
__asm
{
mov AX, 4F05h
mov BX, 0 //表示当前窗口
mov DX, page //在显示存储器中的位面号
int 10h
}
}
void DrawPoint(int x,int y,int len,unsigned char color)
{
*(VideoBufferPtr+y*len+x)=color;
}
void put_bmp(char * bmpfile)
{
int offset,d,c,i,j;
unsigned char r,g,b;
Set_640480_Video_Mode();
if((fp=fopen(bmpfile,"rb"))==NULL) //读取位图
{
printf("Can't open file: %s",bmpfile);
return;
}
fseek(fp,28,SEEK_SET);
fread(&d,2,1,fp);
if(d!=8)
{
printf("%s Not a 256 color bitmap!/n",bmpfile);
fclose(fp);
return;
}
fseek(fp,18,SEEK_SET);
fread(&width,4,1,fp); //读取图片宽度
fseek(fp,22,SEEK_SET);
fread(&length,4,1,fp); //读取图片高度
fseek(fp,54,SEEK_SET);
for(c=0;c<256;c++)
{
b=fgetc(fp);
g=fgetc(fp);
r=fgetc(fp);
_outp(0x3c8,c);
_outp(0x3c9,r>>2);
_outp(0x3c9,g>>2);
_outp(0x3c9,b>>2);
fgetc(fp);
}
//getch();
fseek(fp,10*sizeof(char),SEEK_SET);
fread(&offset,4,1,fp);
fseek(fp,offset*sizeof(char),SEEK_SET);
SelectPlane(0);
for(j=0;j<=101;j++)
for(i=0;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=102;j<=102;j++)
for(i=0;i<256;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
SelectPlane(1);
for(j=102;j<=102;j++)
for(i=256;i<640;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=103;j<=203;j++)
for(i=0;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=204;j<=204;j++)
for(i=0;i<512;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
SelectPlane(2);
for(j=204;j<=204;j++)
for(i=512;i<640;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=205;j<=306;j++)
for(i=0;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=307;j<=307;j++)
for(i=0;i<128;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
SelectPlane(3);
for(j=307;j<=307;j++)
for(i=128;i<640;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=308;j<=408;j++)
for(i=0;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=409;j<=409;j++)
for(i=0;i<384;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
SelectPlane(4);
for(j=409;j<=409;j++)
for(i=384;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
for(j=410;j<=479;j++)
for(i=0;i<width;i++)
{
DrawPoint(i,j,width,fgetc(fp));
}
fclose(fp);
}
最终在MAIN函数里面调用put_bmp("celogo.bmp");
- LOADCEPC设置640*480 BMP
- 在loadcepc.exe中设置bmp
- 设置WINCE6下的LOADCEPC的环境
- LOADCEPC用法详解
- 定制loadcepc.exe
- 编译LOADCEPC.EXE程序
- 设置墙纸(可用htm,bmp)
- 根据bmp设置窗口轮廓
- BMP文件头设置要点
- 动态设置Rave报表BMP图片文件
- BMP
- BMP
- BMP
- BMP
- bmp
- BMP
- BMP
- BMP。。。
- 2440 wince 5.0 BSP之flash驱动分析
- 大学生拿最低工资是谁的错?
- ConcurrentHashMap,一个更快的HashMap
- 从测试角度来看用户手册在软件质量中的地位(转)
- 河床,未开业的低密度特色商业区
- LOADCEPC设置640*480 BMP
- Ibatis入门程序小记
- static变量和static函数的用法摘抄
- jTree 刷新问题 终极解决方法
- EXTjs 列据条件改变字体 颜色
- 大家好
- typeid的用法
- Asp.net FMS 开发视频网站
- 页面跳转