Ed Plunkettとして、ScaleTransformを使用することをおすすめします。あなたは、ユーザーがマウスホイールを動かす方法に応じて異なるScaleTransformを適用することができる。例えば
:ホイールを上に移動する
public partial class MainWindow : Window
{
private double currentZoomFactor = 1;
public MainWindow()
{
InitializeComponent();
}
protected override void OnMouseWheel(MouseWheelEventArgs e)
{
base.OnMouseWheel(e);
FrameworkElement content = Content as FrameworkElement;
if (content != null)
{
if (e.Delta > 0)
{
currentZoomFactor += .1;
content.LayoutTransform = new ScaleTransform(currentZoomFactor, currentZoomFactor);
}
else
{
currentZoomFactor -= .1;
currentZoomFactor = Math.Max(.1, currentZoomFactor);
content.LayoutTransform = new ScaleTransform(currentZoomFactor, currentZoomFactor);
}
}
}
}
はズームになります。ディフェルサホイールダウンはズームアウトを行います。それがあなたを助けることを願っています。
ScaleTransform –