| 语法: | getScreenPixel(x1,y1,x2,y2) | |
|---|---|---|
| 参数 | 类型 | 说明 |
| x1 | 整数类型 | 检测区域左上x坐标 |
| y1 | 整数类型 | 检测区域左上y坐标 |
| x2 | 整数类型 | 检测区域右下x坐标 |
| y2 | 整数类型 | 检测区域右下y坐标 |
return |
w/整数类型 | 范围高度,小于0则表明失败 |
| h/整数类型 | 范围宽度,小于0则表明失败 | |
| arr/数组类型 | 像素数组 | |
| 注意事项 | 区域参数全部写0,表示全屏获取 |
--当前测试在720x1280模式下function printRGB(color)local r,g,b = colorToRGB(color)print("col:".."=>"..r..","..g..","..b)endlocal w,h,arr = getScreenPixel(0,0,0,0)print("image size:"..w..","..h)local x = 567local y = 1231local color = arr[y * w + (x + 1)]local cc = getPixelColor(x,y)printRGB(cc)printRGB(color)
