Click or drag to resize

ImageCompositePrintDocumentPrintImage Event

Occurs before an image is printed during the printing process.

Namespace:  Atalasoft.Imaging.WinControls
Assembly:  Atalasoft.dotImage.WinControls (in Atalasoft.dotImage.WinControls.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public event PrintCompositeEventHandler PrintImage

Value

Type: Atalasoft.Imaging.WinControlsPrintCompositeEventHandler
Remarks
This event must be handled or nothing will be printed. Set the PrintCompositeEventArgs members to specify the image to print, the caption of the image, and to indicate if there are any more images to print.
Examples
Print Images (C#)
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; 
}
Print Images (Visual Basic)
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
See Also