private bool IsOpenend() { Int32Rect invRec = new Int32Rect(624, 70, 400, 50); Color bottomLeftColor = ColorUtils.GetColorAt(6, 745); PointGroupColorDiff invPg = new PointGroupColorDiff(invRec, new Point(0, 0), new Point(0, 1), new Point(88, 6), new Point(292, 6), new Point(352, 13) ); bool opened = false; using (invPg) { invPg.Tolerance = 3; invPg.AddDiff(0, 1, 33); invPg.AddDiff(0, 2, 12); invPg.AddDiff(2, 3, 0); invPg.AddDiff(2, 4, 32, 15); invPg.AddDiff(2, bottomLeftColor, 159); opened = invPg.FindExact(); } return(opened); }
private static Point GetSkillBarLocation() { Int32Rect rect = new Int32Rect(0, 90, 230, 650); Point comparePoint = new Point(464, 742); Color compareColor = ColorUtils.GetColorAt(comparePoint); PointGroupColorDiff points = new PointGroupColorDiff(rect, new Point(0, 0), new Point(-1, 0), new Point(13, 0), new Point(0, 1), new Point(0, 2) ); Point exactPoint; using (points) { points.AddDiff(0, 1, 80); points.AddDiff(0, 2, 47); points.AddDiff(0, 3, 1); points.AddDiff(0, 4, 4); points.AddDiff(0, compareColor, 9); points.Tolerance = 3; exactPoint = points.FindExactPoint(); } return(exactPoint); }
private void InitGroup() { Int32Rect rect = new Int32Rect(100, 100, 800, 600); group = new PointGroupColorDiff(rect, new Point(0, 0), new Point(1, -1), new Point(48, 0), new Point(0, 199), new Point(51, 199), new Point(1, 0) ); group.Tolerance = 3; Color bottomUI = ColorUtils.GetColorAt(464, 753); group.AddDiff(0, 5, 42); group.AddDiff(0, bottomUI, 2); group.AddDiff(0, 1, 0); group.AddDiff(0, 2, 0); group.AddDiff(0, 3, 0); group.AddDiff(0, 4, 0); }