XAML
****************************************************
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600" MouseWheel="Image_MouseWheel" >
Code
****************************************************
Private Sub Image_MouseWheel(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseWheelEventArgs)
If e.Delta > 0 Then
imageScale.ScaleX = imageScale.ScaleX * 1.2
imageScale.ScaleY = imageScale.ScaleY * 1.2
Else
imageScale.ScaleX = imageScale.ScaleX * 0.8
imageScale.ScaleY = imageScale.ScaleY * 0.8
End If
End Sub
沒有留言:
張貼留言