Private Sub ApplyTransform(t As BaseTransform)
Dim newBitmap = bitmap.Transform(t)
bitmap.Dispose()
bitmap = newBitmap
UpdateImage()
End Sub
'ボタンをクリックする時に画像の拡大を行うイベント
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
Dim px As Integer = CInt(bitmap.PixelWidth * 0.625F + 0.5F)
Dim py As Integer = CInt(bitmap.PixelHeight * 0.625F + 0.5F)
If px > 0 AndAlso py > 0 Then
ApplyTransform(New Scaler(px, py, InterpolationMode.HighQualityCubic))
End If
End Sub
'ボタンをクリックする時に画像の縮小を行うイベント
Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
Dim px As Integer = CInt(bitmap.PixelWidth * 1.6F + 0.5F)
Dim py As Integer = CInt(bitmap.PixelHeight * 1.6F + 0.5F)
ApplyTransform(New Scaler(px, py, InterpolationMode.HighQualityCubic))
End Sub