Public Sub RasterImagePrinter_SizeModeChanged()
Dim printer As RasterImagePrinter = New RasterImagePrinter()
AddHandler printer.HorizontalAlignModeChanged, AddressOf printer_HorizontalAlignModeChanged
AddHandler printer.VerticalAlignModeChanged, AddressOf printer_VerticalAlignModeChanged
AddHandler printer.ImageRectangleChanged, AddressOf printer_ImageRectangleChanged
AddHandler printer.PageRectangleChanged, AddressOf printer_PageRectangleChanged
AddHandler printer.PaintPropertiesChanged, AddressOf printer_PaintPropertiesChanged
AddHandler printer.SizeModeChanged, AddressOf printer_SizeModeChanged
printer.HorizontalAlignMode = RasterPaintAlignMode.Near
printer.VerticalAlignMode = RasterPaintAlignMode.Near
printer.ImageRectangle = New Rectangle(0, 0, 100, 100)
printer.PageRectangle = printer.ImageRectangle
printer.PaintProperties = New RasterPaintProperties()
printer.SizeMode = RasterPaintSizeMode.Stretch
RemoveHandler printer.HorizontalAlignModeChanged, AddressOf printer_HorizontalAlignModeChanged
RemoveHandler printer.VerticalAlignModeChanged, AddressOf printer_VerticalAlignModeChanged
RemoveHandler printer.ImageRectangleChanged, AddressOf printer_ImageRectangleChanged
RemoveHandler printer.PageRectangleChanged, AddressOf printer_PageRectangleChanged
RemoveHandler printer.PaintPropertiesChanged, AddressOf printer_PaintPropertiesChanged
RemoveHandler printer.SizeModeChanged, AddressOf printer_SizeModeChanged
End Sub
Private Sub printer_HorizontalAlignModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("HorizontalAlignModeChanged: {0}", printer.HorizontalAlignMode.ToString())
End If
End Sub
Private Sub printer_VerticalAlignModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("VerticalAlignModeChanged: {0}", printer.VerticalAlignMode.ToString())
End If
End Sub
Private Sub printer_ImageRectangleChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("ImageRectangleChanged: {0}", printer.ImageRectangle.ToString())
End If
End Sub
Private Sub printer_PageRectangleChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("PageRectangleChanged: {0}", printer.PageRectangle.ToString())
End If
End Sub
Private Sub printer_PaintPropertiesChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("PaintPropertiesChanged")
Console.WriteLine(Constants.vbTab & "PaintDisplayMode {0} ", printer.PaintProperties.PaintDisplayMode.ToString())
Console.WriteLine(Constants.vbTab & "PaintEngine {0} ", printer.PaintProperties.PaintEngine.ToString())
Console.WriteLine(Constants.vbTab & "RasterOperation {0} ", printer.PaintProperties.RasterOperation.ToString())
Console.WriteLine(Constants.vbTab & "UsePaintPalette {0} ", printer.PaintProperties.UsePaintPalette.ToString())
End If
End Sub
Private Sub printer_SizeModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim printer As RasterImagePrinter = CType(sender, RasterImagePrinter)
If Not printer Is Nothing Then
Console.WriteLine("SizeModeChanged: {0}", printer.SizeMode.ToString())
End If
End Sub |