// Writes the gesture to the sockets. Uses gestures.ToString() method private static void SendToSockets(Pooled gesture, ProcessorState state) { string message = gesture.ToString(); Console.WriteLine("Sending: {0}", message); foreach (var socket in state.all_sockets_.ToList()) socket.Send(message); }
// Draws a crosshair at the specific point in the overlay buffer private static void DrawCrosshairAt(Pooled gesture, ProcessorState state) { System.Drawing.Point xy = gesture.center(); int depth = gesture.center_depth(); int box_length = 20; int x, y; System.Drawing.Color paint = System.Drawing.Color.Black; x = xy.X - box_length / 2; for (int i = 0; i < box_length; i++) { PaintAt(x + i, xy.Y - 1, paint, state); PaintAt(x + i, xy.Y, paint, state); PaintAt(x + i, xy.Y + 1, paint, state); } y = xy.Y - box_length / 2; for (int i = 0; i < box_length; i++) { PaintAt(xy.X - 1, y + i, paint, state); PaintAt(xy.X, y + i, paint, state); PaintAt(xy.X + 1, y + i, paint, state); } state.overlay_start_.Value = true; }