ColorGlove.Pooled.center C# (CSharp) Method

center() public method

public center ( ) : Point
return Point
        public Point center() { return center_; }
        public int center_depth() { return center_depth_; }

Usage Example

コード例 #1
0
        // 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;
        }