Private Sub ApplyTransform(t As BaseTransform)
Dim newBitmap = bitmap.Transform(t)
bitmap.Dispose()
bitmap = newBitmap
selection = New RectF(1.0F, 1.0F)
UpdateImage()
End Sub
'Event to scale out the image on button click
Private Sub Button2_Click(sender As Object, e As EventArgs) _
Handles Button2.Click
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, _
C1.Win.Bitmap.InterpolationMode.HighQualityCubic))
End Sub
'Event to scale in the image on button click
Private Sub Button3_Click(sender As Object, e As EventArgs) _
Handles Button3.Click
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, _
C1.Win.Bitmap.InterpolationMode.HighQualityCubic))
End If
End Sub