[quote=引用 11 楼 HSFZXJY 的回复:] [quote=引用 10 楼 lm_whales 的回复:] [quote=引用 9 楼 HSFZXJY 的回复:] [quote=引用 8 楼 lm_whales 的回复:] TPoint;TRect 都是整型 你的坐标都是浮点型,要做某种比例变换,和四舍五入之类的处理,然后才能用PtInRect 不过这PtInRect,在delphi也应该是,库函数(内部函数才对),应该不需要自己定义了。
[quote=引用 10 楼 lm_whales 的回复:] [quote=引用 9 楼 HSFZXJY 的回复:] [quote=引用 8 楼 lm_whales 的回复:] TPoint;TRect 都是整型 你的坐标都是浮点型,要做某种比例变换,和四舍五入之类的处理,然后才能用PtInRect 不过这PtInRect,在delphi也应该是,库函数(内部函数才对),应该不需要自己定义了。
[quote=引用 9 楼 HSFZXJY 的回复:] [quote=引用 8 楼 lm_whales 的回复:] TPoint;TRect 都是整型 你的坐标都是浮点型,要做某种比例变换,和四舍五入之类的处理,然后才能用PtInRect 不过这PtInRect,在delphi也应该是,库函数(内部函数才对),应该不需要自己定义了。
[quote=引用 8 楼 lm_whales 的回复:] TPoint;TRect 都是整型 你的坐标都是浮点型,要做某种比例变换,和四舍五入之类的处理,然后才能用PtInRect 不过这PtInRect,在delphi也应该是,库函数(内部函数才对),应该不需要自己定义了。
TPoint;TRect 都是整型 你的坐标都是浮点型,要做某种比例变换,和四舍五入之类的处理,然后才能用PtInRect 不过这PtInRect,在delphi也应该是,库函数(内部函数才对),应该不需要自己定义了。
function PtInRect(pt: TPoint;rect: TRect): boolean; begin result := (pt.X > rect.Left) and (pt.X < rect.Right) and (pt.Y < rect.Bottom) and (pt.Y > rect.Top); end;
16,748
社区成员
33,247
社区内容
加载中
试试用AI创作助手写篇文章吧