mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:55:36 +08:00
41 lines
846 B
HTML
41 lines
846 B
HTML
<h1>标准库函数 - getpixel</h1>
|
||
|
||
|
||
<p>原型:extern int getpixel(int x, int y);</p>
|
||
|
||
<p>用法:#include <system.h></p>
|
||
|
||
<p>功能:返回屏幕上指定点的状态</p>
|
||
|
||
<p>说明:(x,y)为屏幕上点的坐标,如果点为清除状态返回零,否则返回非零值。</p>
|
||
|
||
举例:<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="putpixel.html">putpixel</a>
|
||
|