while((right_y-left_y)*(left_x-x)<(left_x-right_x)*(y-left_y))
{
x--;
Pixel24TrC(color,x,y);
}
x--;
if(!(y<right_y))
continue;
if((right_y-left_y)>(left_x-right_x))
while((right_y-left_y)*(left_x-x)>(left_x-right_x)*(y-left_y))
{
y++;
Pixel24TrC(color,x,y);
}
y++;
};
while(y<=right_y)
{
Pixel24TrC(color,x,y);
y++;
};
}
else
if(left_y>right_y)
{
while(x<right_x)
{
Pixel24TrC(color,x,y);
if((right_x-left_x)>(left_y-right_y))
while((left_y-right_y)*(x-left_x)<(right_x-left_x)*(left_y-y))
{
x++;
Pixel24TrC(color,x,y);
}
x++;
if(left_y-y>left_y-right_y)
continue;
if((left_y-right_y)>(right_x-left_x))
while((left_y-right_y)*(x-left_x)>(right_x-left_x)*(left_y-y))
{
y--;
Pixel24TrC(color,x,y);
}
y--;
};
while(left_y-y<=left_y-right_y)
{
Pixel24TrC(color,x,y);
y--;
};
}
else
{
while(x<right_x)
{
Pixel24TrC(color,x,y);
if((right_x-left_x)>(right_y-left_y))
while((right_y-left_y)*(x-left_x)<(right_x-left_x)*(y-left_y))
{
x++;
Pixel24TrC(color,x,y);
}
x++;
if(y>=right_y)
continue;
if((right_y-left_y)>(right_x-left_x))
while((right_y-left_y)*(x-left_x)>(right_x-left_x)*(y-left_y))
{
y++;
Pixel24TrC(color,x,y);
}
y++;
};
while(y<=right_y)
{
Pixel24TrC(color,x,y);
y++;
};
}
return 0;
}
[/code:1:9253783525]
a.h 头文件
[code:1:9253783525]
#define LINE 640
#define C256(R,G,B) (unsigned char)R*0x20%0x100+(unsigned char)G*0x4%0x20+B
#define Hi15(R,G,B) (unsigned)R*0x400%0x8000+(unsigned)G*0x20%0x400+(char)B%0x20
#define HiC(R,G,B) (unsigned)R*0x800%0x10000+(unsigned)G*32%0x800+(char)B%0x20
#define TrC(R,G,B) (unsigned long)R*0x10000%0x1000000+(unsigned long)G*0x100%0x10000+(unsigned)B%0x100
#define Hi-TrC(RGB) (unsigned long)RGB%0x10000/2048*65536+(unsigned long)RGB%2048/32*256+(unsigned char)RGB%32
#define Tr-HiC(RGB) (unsigned long)RGB%0x1000000/65536%32*2048+(unsigned long)RGB%65536/64*32+(unsigned char)(RGB%32)
#define C256_640_400 0x100
#define C256_640_480 0x101
#define C16_800_600 0x102
#define C256_800_600 0x103
#define C16_1024_768 0x104
#define C256_1024_768 0x105
#define Hi15_640_480 0x110
#define Hi640_480 0x111
#define Tr640_480 0x112
#define Hi15_800_600 0x113
#define Hi800_600 0x114
#define Tr800_600 0x115
#define Hi15_1024_768 0x116
#define Hi1024_768 0x117
#define Tr1024_768 0x118
extern void Demo(unsigned long,int,int);
extern void init(int);
extern void Pixel16HiC(int,int,int);
extern void Pixel24TrC(unsigned long,int,int);
extern void Pixel256C(char,int,int);
extern void line(unsigned long x1,unsigned long y1,unsigned long x2,unsigned long y2,unsigned long color);
/*seepic*/
extern unsigned far* readpic(FILE *fp);
extern void mouse(void);
struct bmp_head
{
int other1;
unsigned long length;
char other2[4];
unsigned int offset;
char other3[6];
unsigned int width;
char other4[2];
unsigned int hight;
char other5[4];
unsigned char color;
};
[/code:1:9253783525]
mybmp.c这是嵌入式汇编的画点函数
[code:1:9253783525]
void init(int mode)
{
asm mov bx,mode
asm mov ax,4f02h
asm int 10h
return;
}
void Pixel24TrC(unsigned long color,int x,int y)
相关文章
上一篇文章:DOS可以当积木来砌
下一篇文章:DOS教学应上时代的发展才行
- 推荐阅讯
- Help命令使用说明
- DOS教学应上时代的发展才行
- 让Windows 98自动安装
- 告别黑底白字 打造漂亮的CMD命令行
- 自定义Windows 98的启动方式
- DOS命令 Type
- DOS命令 format
- Windows 95无盘工作站如何上网
- DOS下对系统重新进行分区
- DOS命令 Net start/stop
- 阅读排行
- 1.DOS命令 Copy
- 2.Windows 98的系统设置与优化
- 3.如何在WinNT/2K/XP下启动纯DOS
- 4.操作系统进程描述
- 5.用二种方法打开DOS命令窗口
- 6.DOS命令 cd
- 7.DOS命令 At
- 8.DOS命令 Xcopy
- 9.Windows ME
- 10.给Windows一个绿色文件夹
- 专题教程
- Windows Server-Windows Server文档-Windows Server新闻-Windows Ser PostgreSQL-PostgreSQL文档-PostgreSQL新闻-PostgreSQL专家
- WebLogic-WebLogic文档-WebLogic新闻-WebLogic专家 FreeBSD-FreeBSD文档-FreeBSD新闻-FreeBSD专家
- Linux-内核 GUI KDE Gnome DNS FTP 安全 安装-Linux专区 Windows-AD IIS ServerCore 虚拟化 安全 HPC-Windows专区
- 大话G游 专题:手机病毒揭密
- ARP攻击防范与解决方案 路由故障处理手册
