using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Emgu.CV; using Emgu.CV.Structure; using bbiwarg.Utility; namespace bbiwarg.Images { public enum TouchImageState { none = 0, touchArea = 1, touchAreaMatched = 2, touchAreaStatusBar = 3, touchDetected = 4, touchTracked = 5 } class TouchImage { private Image image; private List oldTouches; public TouchImage(int width, int height) { image = new Image(width, height); oldTouches = new List(); } public void setTouchAt(int x, int y, TouchImageState tis) { image.Data[y, x, 0] = (byte)tis; int size = 5; if (tis == TouchImageState.touchTracked || tis == TouchImageState.touchDetected) { image.Draw(new CircleF(new System.Drawing.PointF(x, y), 5), new Gray((byte) tis), 0); } } public TouchImageState getStateAt(int x, int y) { return (TouchImageState)image.Data[y, x, 0]; } } }