DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / PrinterImage Method / PrinterImage(Int32,Int32,Boolean,Matrix,Rectangle,Int32,Int32) Method

Bit depth of final image (must be 8-16, but always 8 when Planes=3)

1 for monochrome and 3 for colour

Controls whether annotations are "burnt-in" to the new image

The transform to apply to the pixels - this includes zoom etc.

The output area to be filled

The frame number to use. This is 1-index, i.e. first frame is 1 not 0

The planar configuration value of the resulting image. For use in Printing, this should be 1 as defined by DICOM rules, but if this function is used for other purposes, then 0 may be required.

Example

In This Topic
    PrinterImage(Int32,Int32,Boolean,Matrix,Rectangle,Int32,Int32) Method
    In This Topic
    Creates a copy of the image for printing or other purposes
    Syntax
    'Declaration
     
    
    Public Overloads Function PrinterImage( _
       ByVal Bits As System.Integer, _
       ByVal Planes As System.Integer, _
       ByVal ShowAnnotations As System.Boolean, _
       ByVal Matrix As System.Drawing.Drawing2D.Matrix, _
       ByVal FinalArea As System.Drawing.Rectangle, _
       ByVal Frame As System.Integer, _
       ByVal PlanarConfig As System.Integer _
    ) As DicomImage
    public DicomImage PrinterImage( 
       System.int Bits,
       System.int Planes,
       System.bool ShowAnnotations,
       System.Drawing.Drawing2D.Matrix Matrix,
       System.Drawing.Rectangle FinalArea,
       System.int Frame,
       System.int PlanarConfig
    )

    Parameters

    Bits

    Bit depth of final image (must be 8-16, but always 8 when Planes=3)

    Planes

    1 for monochrome and 3 for colour

    ShowAnnotations

    Controls whether annotations are "burnt-in" to the new image

    Matrix

    The transform to apply to the pixels - this includes zoom etc.

    FinalArea

    The output area to be filled

    Frame

    The frame number to use. This is 1-index, i.e. first frame is 1 not 0

    PlanarConfig

    The planar configuration value of the resulting image. For use in Printing, this should be 1 as defined by DICOM rules, but if this function is used for other purposes, then 0 may be required.

    Return Value

    Remarks
    The copy is fully rendered and scaled to the chosen bit depth, so no further windowing is required. Only 8 bits are allowed when Planes=3 (RGB). Area refers to the original image � the size of the final image is the product of the cropped size and the chosen zoom. If the edges are given as 0, the full image is used.
    Example
    DicomImage image = new DicomImage("your_dicom_image.dcm");
                
    int bits = 8;
    int planes = 1; // RGB = 3
    bool showAnnotations = true;
    Matrix matrix = image.Matrix(image.Size);
    Rectangle area = new Rectangle(0, 0, 512, 512);
    int frame = 1;
    int planarConfig = 1;
                        
    var printerImage = image.PrinterImage(bits, planes, showAnnotations, matrix, area, frame, planarConfig);
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also