Private Sub magnifyGlass_CrosshairChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("Crosshair Changed to " & magnifyGlass.Crosshair.ToString())
End Sub
Private Sub magnifyGlass_CrosshairColorChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("CrosshairColor Changed to " & magnifyGlass.CrosshairColor.ToString())
End Sub
Private Sub magnifyGlass_CrosshairWidthChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("CrosshairWidth Changed to " & magnifyGlass.CrosshairWidth.ToString())
End Sub
Private Sub magnifyGlass_Border3DStyleChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("Border3DStyle Changed to " & magnifyGlass.Border3DStyle.ToString())
End Sub
Private Sub magnifyGlass_BorderColorChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("BorderColor Changed to " & magnifyGlass.BorderColor.ToString())
End Sub
Private Sub magnifyGlass_BorderWidthChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("BorderWidth Changed to " & magnifyGlass.BorderWidth.ToString())
End Sub
Private Sub magnifyGlass_ShapeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("Shape Changed to " & magnifyGlass.Shape.ToString())
End Sub
Private Sub magnifyGlass_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("Size Changed to " & magnifyGlass.Size.ToString())
End Sub
Private Sub magnifyGlass_ScaleFactorChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("Scale Factor Changed to " & magnifyGlass.ScaleFactor.ToString())
End Sub
Private Sub magnifyGlass_RoundRectangleEllipseSizeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim magnifyGlass As RasterMagnifyGlass = CType(IIf(TypeOf sender Is RasterMagnifyGlass, sender, Nothing), RasterMagnifyGlass)
Console.WriteLine("RoundRectangleEllipseSize Changed to " & magnifyGlass.RoundRectangleEllipseSize.ToString())
End Sub
Public Sub RasterMagnifyGlass_Border3DStyle(ByVal viewer As RasterImageViewer)
viewer.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass
AddHandler viewer.MagnifyGlass.CrosshairChanged, AddressOf magnifyGlass_CrosshairChanged
AddHandler viewer.MagnifyGlass.CrosshairColorChanged, AddressOf magnifyGlass_CrosshairColorChanged
AddHandler viewer.MagnifyGlass.CrosshairWidthChanged, AddressOf magnifyGlass_CrosshairWidthChanged
AddHandler viewer.MagnifyGlass.Border3DStyleChanged, AddressOf magnifyGlass_Border3DStyleChanged
AddHandler viewer.MagnifyGlass.BorderColorChanged, AddressOf magnifyGlass_BorderColorChanged
AddHandler viewer.MagnifyGlass.BorderWidthChanged, AddressOf magnifyGlass_BorderWidthChanged
AddHandler viewer.MagnifyGlass.ShapeChanged, AddressOf magnifyGlass_ShapeChanged
AddHandler viewer.MagnifyGlass.SizeChanged, AddressOf magnifyGlass_SizeChanged
AddHandler viewer.MagnifyGlass.ScaleFactorChanged, AddressOf magnifyGlass_ScaleFactorChanged
AddHandler viewer.MagnifyGlass.RoundRectangleEllipseSizeChanged, AddressOf magnifyGlass_RoundRectangleEllipseSizeChanged
If viewer.MagnifyGlass.Shape <> RasterMagnifyGlassShape.Border3D Then
viewer.MagnifyGlass.Shape = RasterMagnifyGlassShape.Border3D
viewer.MagnifyGlass.Border3DStyle = Border3DStyle.Sunken
viewer.MagnifyGlass.Shape = RasterMagnifyGlassShape.RoundRectangle
viewer.MagnifyGlass.RoundRectangleEllipseSize = New Size(15, 15)
viewer.MagnifyGlass.BorderColor = Color.DarkBlue
viewer.MagnifyGlass.BorderWidth = 10
viewer.MagnifyGlass.Crosshair = RasterMagnifyGlassCrosshair.Fine
viewer.MagnifyGlass.CrosshairColor = Color.Red
viewer.MagnifyGlass.CrosshairWidth = 5
viewer.MagnifyGlass.Size = New Size(200, 100)
viewer.MagnifyGlass.ScaleFactor = 1.5F
End If
RemoveHandler viewer.MagnifyGlass.CrosshairChanged, AddressOf magnifyGlass_CrosshairChanged
RemoveHandler viewer.MagnifyGlass.CrosshairColorChanged, AddressOf magnifyGlass_CrosshairColorChanged
RemoveHandler viewer.MagnifyGlass.CrosshairWidthChanged, AddressOf magnifyGlass_CrosshairWidthChanged
RemoveHandler viewer.MagnifyGlass.Border3DStyleChanged, AddressOf magnifyGlass_Border3DStyleChanged
RemoveHandler viewer.MagnifyGlass.BorderColorChanged, AddressOf magnifyGlass_BorderColorChanged
RemoveHandler viewer.MagnifyGlass.BorderWidthChanged, AddressOf magnifyGlass_BorderWidthChanged
RemoveHandler viewer.MagnifyGlass.ShapeChanged, AddressOf magnifyGlass_ShapeChanged
RemoveHandler viewer.MagnifyGlass.SizeChanged, AddressOf magnifyGlass_SizeChanged
RemoveHandler viewer.MagnifyGlass.ScaleFactorChanged, AddressOf magnifyGlass_ScaleFactorChanged
RemoveHandler viewer.MagnifyGlass.RoundRectangleEllipseSizeChanged, AddressOf magnifyGlass_RoundRectangleEllipseSizeChanged
End Sub |