Public Class MyTiledImageViewer
Inherits TiledImageViewer
Protected Overrides Sub OnInputProfileChanged(ByVal e As EventArgs)
MyBase.OnInputProfileChanged(e)
Console.WriteLine("OnInputProfileChanged is called")
End Sub
Protected Overrides Sub OnOutputProfileChanged(ByVal e As EventArgs)
MyBase.OnOutputProfileChanged(e)
Console.WriteLine("OnOutputProfileChanged is called")
End Sub
Protected Overrides Sub OnImageUrlChanged(ByVal e As EventArgs)
MyBase.OnImageUrlChanged(e)
Console.WriteLine("OnImageUrlChanged is called")
End Sub
Protected Overrides Sub OnScaleFactorChanged(ByVal e As EventArgs)
MyBase.OnScaleFactorChanged(e)
Console.WriteLine("OnScaleFactorChanged is called")
End Sub
Protected Overrides Sub OnSizeModeChanged(ByVal e As EventArgs)
MyBase.OnSizeModeChanged(e)
Console.WriteLine("OnSizeModeChanged is called")
End Sub
Protected Overrides Sub OnHorizontalAlignModeChanged(ByVal e As EventArgs)
MyBase.OnHorizontalAlignModeChanged(e)
Console.WriteLine("OnHorizontalAlignModeChanged is called")
End Sub
Protected Overrides Sub OnVerticalAlignModeChanged(ByVal e As EventArgs)
MyBase.OnVerticalAlignModeChanged(e)
Console.WriteLine("OnVerticalAlignModeChanged is called")
End Sub
Protected Overrides Sub OnResourcesPathChanged(ByVal e As EventArgs)
MyBase.OnResourcesPathChanged(e)
Console.WriteLine("OnResourcesPathChanged is called")
End Sub
Protected Overrides Sub OnScrollBarVisibleChanged(ByVal e As EventArgs)
MyBase.OnScrollBarVisibleChanged(e)
Console.WriteLine("OnScrollBarVisibleChanged is called")
End Sub
Protected Overrides Sub OnScrollBarStyleChanged(ByVal e As EventArgs)
MyBase.OnScrollBarStyleChanged(e)
Console.WriteLine("OnScrollBarStyleChanged is called")
End Sub
Protected Overrides Sub OnTileWidthChanged(ByVal e As EventArgs)
MyBase.OnTileWidthChanged(e)
Console.WriteLine("OnTileWidthChanged is called")
End Sub
Protected Overrides Sub OnTileHeightChanged(ByVal e As EventArgs)
MyBase.OnTileHeightChanged(e)
Console.WriteLine("OnTileHeightChanged is called")
End Sub
End Class
Public Sub TestMyImageViewer()
Dim myViewer As MyTiledImageViewer = New MyTiledImageViewer()
AddHandler myViewer.InputProfileChanged, AddressOf myViewer_InputProfileChanged
AddHandler myViewer.OutputProfileChanged, AddressOf myViewer_OutputProfileChanged
AddHandler myViewer.ImageUrlChanged, AddressOf myViewer_ImageUrlChanged
AddHandler myViewer.ScaleFactorChanged, AddressOf myViewer_ScaleFactorChanged
AddHandler myViewer.SizeModeChanged, AddressOf myViewer_SizeModeChanged
AddHandler myViewer.HorizontalAlignModeChanged, AddressOf myViewer_HorizontalAlignModeChanged
AddHandler myViewer.VerticalAlignModeChanged, AddressOf myViewer_VerticalAlignModeChanged
AddHandler myViewer.ScrollBarVisibleChanged, AddressOf myViewer_ScrollBarVisibleChanged
AddHandler myViewer.ScrollBarStyleChanged, AddressOf myViewer_ScrollBarStyleChanged
AddHandler myViewer.TileWidthChanged, AddressOf myViewer_TileWidthChanged
AddHandler myViewer.TileHeightChanged, AddressOf myViewer_TileHeightChanged
AddHandler myViewer.ResourcesPathChanged, AddressOf myViewer_ResourcesPathChanged
myViewer.InputProfile = String.Empty
myViewer.OutputProfile = String.Empty
myViewer.ScaleFactor = 150
myViewer.SizeMode = ImageViewerSizeMode.Normal
myViewer.ScrollBarStyle = TiledImageViewerScrollBarStyle.Xp
myViewer.ScrollBarVisible = True
myViewer.HorizontalAlignMode = ImageViewerAlignMode.Center
myViewer.VerticalAlignMode = ImageViewerAlignMode.Center
myViewer.TileWidth = 250
myViewer.TileHeight = 250
myViewer.ResourcesPath = "/Resources/"
myViewer.ImageUrl = "Image1.cmp"
End Sub
Sub myViewer_InputProfileChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("InputProfile Changed to " + viewer.InputProfile)
End If
End Sub
Sub myViewer_OutputProfileChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("OutputProfile Changed to " + viewer.OutputProfile)
End If
End Sub
Sub myViewer_ImageUrlChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("ImageUrl Changed to " + viewer.ImageUrl)
End If
End Sub
Sub myViewer_ScaleFactorChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("ScaleFactor Changed to " + viewer.ScaleFactor.ToString())
End If
End Sub
Sub myViewer_SizeModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("SizeMode Changed to " + viewer.SizeMode.ToString())
End If
End Sub
Sub myViewer_HorizontalAlignModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("HorizontalAlignMode Changed to " + viewer.HorizontalAlignMode.ToString())
End If
End Sub
Sub myViewer_VerticalAlignModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("VerticalAlignMode Changed to " + viewer.VerticalAlignMode.ToString())
End If
End Sub
Sub myViewer_ScrollBarVisibleChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("ScrollBarVisible Changed to " + viewer.ScrollBarVisible.ToString())
End If
End Sub
Sub myViewer_ScrollBarStyleChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("ScrollBarStyle Changed to " + viewer.ScrollBarStyle.ToString())
End If
End Sub
Sub myViewer_TileWidthChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("TileWidth Changed to " + viewer.TileWidth.ToString())
End If
End Sub
Sub myViewer_TileHeightChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("TileHeight Changed to " + viewer.TileHeight.ToString())
End If
End Sub
Sub myViewer_ResourcesPathChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As MyTiledImageViewer = CType(sender, MyTiledImageViewer)
If Not viewer Is Nothing Then
Console.WriteLine("ResourcesPath Changed to " + viewer.ResourcesPath.ToString())
End If
End Sub |