0

キャンバス内のオブジェクトを移動する方法を示す多くの投稿を見てきましたが、必要なのは、1. キャンバス全体とそのすべての子を移動する方法、または 2. すべてのオブジェクトを手動で移動する方法です (これは確かにお勧めできません)。

Canvas を ScrollViewer に入れました。私の実際の問題は次のとおりです。ScaleTransformを使用してキャンバスをズームしようとしていますが、ズームした後、クリックしたポイントがズーム後に中心になるようにスクロールビューアをポイントに移動する必要もあります。

Canvas.SetLeft() と Canvas.SetTop() を試しましたが、運が悪かった..

何か案が?

前もって感謝します..

4

2 に答える 2

0

これは、あなたがしていることに役立つかもしれません:

http://autoscroller.codeplex.com/

于 2012-09-17T16:33:21.187 に答える
0

You can communicate with the ScrollViewer to make it scroll its content to a particular offset by using ScrollToVerticalOffset and ScrollToHorizontalOffset.

You'll need to calculate the correct offset by taking into account the size of the "viewport" i.e. the area that you can see of the content, and the zoom level.

于 2012-09-15T14:28:54.710 に答える