uTools-Manuals/docs/c/getpixel.html
2019-04-08 23:22:26 +08:00

41 lines
846 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>标准库函数 - getpixel</h1>
<p>原型extern int getpixel(int x, int y);</p>
<p>用法:#include &lt;system.h></p>
<p>功能:返回屏幕上指定点的状态</p>
<p>说明:(x,y)为屏幕上点的坐标,如果点为清除状态返回零,否则返回非零值。</p>
举例:<pre>
// pixel.c
#include &lt;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>