コード例 #1
0
ファイル: ImagePoint.cs プロジェクト: rissstep/IFGPro
        public bool IsHit(Point p, Cyotek.Windows.Forms.ImageBox i, bool isFringe = false)
        {
            if (isFringe)
            {
                p = i.PointToImage(p);
                if ((p.X - location.X) * (p.X - location.X) + (p.Y - location.Y) * (p.Y - location.Y) <= ratio * ratio)
                    return true;
                return false;
            }

            p = i.GetOffsetPoint(p);
            PointF offsetPoint = i.GetOffsetPoint(location);
            if ((p.X - offsetPoint.X) * (p.X - offsetPoint.X) + (p.Y - offsetPoint.Y) * (p.Y - offsetPoint.Y) <= ratio * ratio)
                return true;
            return false;
        }