Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 inkcanvas 中,我可以绘制笔触,我想在其中找到笔触的位置(上、左、右、下)。如果在 inkcanvas 控件的顶部绘制笔划,则笔划位置在顶部。当我使用 getBounds() 时如何找到它并不能帮助我找到绘制笔划的顶部位置
GetBounds()正在为我工作。就我而言,我正在拦截 InkCanvas StrokeCollected 事件并执行以下操作:
GetBounds()
Rect bounds = e.Stroke.GetBounds();
它给了我顶部、左侧、右侧和底部。
如果您需要单个点的位置,例如第一个或最后一个点,您可以使用收集的笔画的 StylusPoints 属性来访问它们。