mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-05-06 11:46:09 +08:00
44 lines
960 B
HTML
44 lines
960 B
HTML
<h1>标准库函数 - putpixel</h1>
|
|
|
|
|
|
<p>原型:extern void putpixel(int x, int y, int mode);</p>
|
|
|
|
<p>用法:#include <system.h></p>
|
|
|
|
<p>功能:在屏幕的指定位置上画点</p>
|
|
|
|
<p>说明:(x,y)为屏幕上点的坐标,mode值含义如下:</p>
|
|
mode=0:清除(x,y)处的点
|
|
1:在(x,y)处画点
|
|
2:将(x,y)处的点的状态取反
|
|
|
|
举例:<pre>
|
|
|
|
// pixel.c
|
|
|
|
#include <system.h>
|
|
|
|
main()
|
|
{
|
|
int i,j;
|
|
|
|
clrscr();
|
|
printf("V");
|
|
gotoxy(10,10); // Hide cursor
|
|
|
|
for(i=0;i<8;i++)
|
|
for(j=0;j<16;j++)
|
|
{
|
|
if(getpixel(i,j))
|
|
putpixel(10+i,10+j,1);
|
|
else
|
|
putpixel(10+i,10+j,0);
|
|
}
|
|
|
|
getchar();
|
|
return 0;
|
|
}
|
|
|
|
</pre>相关函数:<a href="getpixel.html">getpixel</a>
|
|
|