quacka#1104
I have two bitmapviewer, one with the Rectanglerubberband control on it and another is to display the area highlighted by the Rectanglerubberband control.
My problem is I don't know the right way to display the selected area. I am using the following code but I assume it will be slow as I need to reload the original image from file each time, then crop the image according to the Rectanglerubberband.
There has to be a more resource friendly way to do this.
My problem is I don't know the right way to display the selected area. I am using the following code but I assume it will be slow as I need to reload the original image from file each time, then crop the image according to the Rectanglerubberband.
bmvEdit.Bitmap.Load(ImageName)
bmvOriginal.Bitmap.Load(ImageName)
RectangleRubberband1.Connect(bmvOriginal)
Private Sub RectangleRubberband1_RectangleChanged(ByVal sender As Object, ByVal e As Aurigma.GraphicsMill.WinControls.RectangleEventArgs) Handles RectangleRubberband1.RectangleChanged
RectangleRubberband1.ResizeMode = WinControls.ResizeMode.Proportional
If Not RectangleRubberband1.Rectangle = Nothing Then
bmvEdit.Bitmap.Load(ImageName)
Dim Transform As BitmapTransform
Transform = New Crop(RectangleRubberband1.Rectangle)
Transform.ApplyTransform(bmvEdit.Bitmap)
End If
End Sub
There has to be a more resource friendly way to do this.