ImageCompositePrintDocument.PrintImage Event |
Namespace: Atalasoft.Imaging.WinControls
private void imageCompositePrintDocument1_PrintImage(object sender, Atalasoft.Imaging.WinControls.PrintCompositeEventArgs e) { if (_folders != null && _folders.Length > e.ImageIndex) { //specify the image to print e.Image = new AtalaImage(_folders[e.ImageIndex]); //specify the caption of the image e.Caption = System.IO.Path.GetFileName(_folders[e.ImageIndex]); } //tell Print Document if there are more images/pages to print after this one if (e.ImageIndex >= _folders.Length - 1) e.HasMorePages = false; else e.HasMorePages = true; }
Private Sub imageCompositePrintDocument1_PrintImage(ByVal sender As Object, ByVal e As Atalasoft.Imaging.WinControls.PrintCompositeEventArgs) Handles imageCompositePrintDocument1.PrintImage If _folders <> Nothing And _folders.Length > e.ImageIndex Then 'specify the image to print e.Image = New AtalaImage(_folders(e.ImageIndex)) 'specify the caption of the image e.Caption = System.IO.Path.GetFileName(_folders(e.ImageIndex)) End If 'tell Print Document if there are more images/pages to print after this one If e.ImageIndex >= _folders.Length - 1 Then e.HasMorePages = False Else e.HasMorePages = True End If End Sub