コード例 #1
0
        public virtual Point[] GetArrowThumbRegion(Point thumbPos)
        {
            TrackBarObjectPainter pt = TrackPainter;

            int[,] offsetP1 = { { 0, 11 }, { -pt.GetThumbBestWidth(this) / 2, 6 }, { -pt.GetThumbBestWidth(this) / 2, -9 }, { pt.GetThumbBestWidth(this) / 2, -9 }, { pt.GetThumbBestWidth(this) / 2, 6 }, { 0, 11 } };
            Point[] polygon = new Point[6];
            TransformPoints(offsetP1, polygon, thumbPos);
            return(polygon);
        }
コード例 #2
0
        public virtual Point[] GetRectThumbRegion(Point thumbPos)
        {
            TrackBarObjectPainter pt = TrackPainter;
            int top    = -pt.GetThumbBestHeight(this) / 2;
            int left   = -pt.GetThumbBestWidth(this) / 2;
            int width  = pt.GetThumbBestWidth(this);
            int height = pt.GetThumbBestHeight(this);

            int[,] offsetP1 =
            {
                { left,         top + height },
                { left,         top          },
                { left + width, top          },
                { left + width, top + height },
                { left,         top + height }
            };
            Point[] polygon = new Point[5];
            TransformPoints(offsetP1, polygon, thumbPos);
            return(polygon);
        }