include<stdio.h>
include<windows.h>
include<graphics.h>
include<atlimage.h>
int main()
{
//system("adb pull /sdcard/screen.png");
//system("adb shell screencap -p /sdcard/screen.png");
//system("adb shell input swipe 200 200 195 195 650");
//获取手机实时画面
//创建显示界面 显示控制台
initgraph(900, 900,SHOWCONSOLE);
IMAGE screen, img;
CImage cimage;
cimage.Load("screen.png");
cimage.Save("screen.jpg");
//修改图片格式
loadimage(&screen, "screen.jpg");
SetWorkingImage(&screen);
getimage(&img,54,400,900,900);
//100是x坐标,800是y坐标(y是向下的)
SetWorkingImage(NULL);
//裁剪图片的大小
putimage(0, 0, &img);
//获取起点坐标
int x, y;
for (y = 899; y >= 0; y--)//从下往上找
{
int flag = 0;
for (x = 0; x < 900; x++)
{
if (RGB(60, 48, 84) == getpixel(x, y))
{
flag = 1;
break;
}
}
if (flag)
{
break;
}
}
printf("起点的坐标是:%d,%d", x, y);
////获取终点坐标
//COLORREF bk = getpixel(10, 10);
//int dx, dy;
//for (dy = 899; dy >= 0; dy--);
//{
// int flag = 0;
// for (dx = 0; dx < 900; dx++)
// {
// if (RGB(200, 200, 200) == getpixel(dx, dy));
// {
// flag = 1;
// break;
// }
// }
//
//
//
//
//
//}
while (1);
return 0;
}