wpf 鼠标滚动轮缩放MouseWheel

var pointToContent = group.Inverse.Transform(point);
var transform = group.Children[0] as ScaleTransform;
if (transform.ScaleX + delta < min) return;
if (transform.ScaleX + delta > max) return;
transform.ScaleX += delta;
transform.ScaleY += delta;
var transform1 = group.Children[1] as TranslateTransform;
transform1.X = -1 * ((pointToContent.X * transform.ScaleX) - point.X);
transform1.Y = -1 * ((pointToContent.Y * transform.ScaleY) - point.Y);

转载于:https://www.cnblogs.com/pengde/p/9237938.html

你可能感兴趣的:(wpf 鼠标滚动轮缩放MouseWheel)