开发者

How can I zoom with mouse scroll on WPF TrackballDecorator (3dTools)?

开发者 https://www.devze.com 2023-02-15 15:14 出处:网络
Currently I can zoom using right click. Is there a s开发者_开发技巧imple method to do it with mouse scroll ?

Currently I can zoom using right click. Is there a s开发者_开发技巧imple method to do it with mouse scroll ?

Thanks.


Try something like this:

protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
            {
            base.OnPreviewMouseWheel(e);
            if(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
            {
                yourObject.Value += (e.Delta > 0) ? 0.2 : -0.2;
            }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号