If you are doing a multi-page tiff, you need to do a little bit more on top of what kebo mentioned, as you need to print multiple pages:
Code:Dim img As Image Dim pgnum As Integer = 0 Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click img = Image.FromFile("C:\Temp\0000000C.TIF") Dim p As New PrintDocument AddHandler p.PrintPage, New PrintPageEventHandler(AddressOf pd_Print) p.Print() End Sub Private Sub pd_Print(ByVal sender As Object, ByVal e As PrintPageEventArgs) If pgnum < (img.GetFrameCount(Imaging.FrameDimension.Page) - 1) Then e.Graphics.DrawImage(img, 10, 10) pgnum += 1 img.SelectActiveFrame(Imaging.FrameDimension.Page, pgnum) e.HasMorePages = True Else e.Graphics.DrawImage(img, 10, 10) e.HasMorePages = False End If End Sub




Reply With Quote