DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / Export Method / Export(String,Object) Method

The type of export operation to perform

The quality factor to be used. This is a generic compression quality depending on the Transfer Syntax used. This can be an integer that specifies the value stored in the System.Drawing.Imaging.EncoderParameter object for Bitmap export. This value for JPEG Baseline and JPEG Extended compression represents an integer between 0 – 100. This tells DicomObjects to set up the compressor to try to achieve the quality in percentage (higher quality value towards 100 means better quality and lower compression ratio). And for JPEG-LS Lossy and JPEG2000 Lossy compression this value is actually the desired compression ratio, i.e. if you set the quality value to 10, it tells DicomObjects to try to achieve compression ratio of 10. The actual compression ratio achieved will not be exactly the same as specified by quality value but close enough. The actual compression ratio is calculated based on the original data size and the compressed data size before it is added to “Lossy Image Compression Ratio” tag of the image. For Video compression, this value directly corresponds to the BitsPerSecond of the compressed video.







In This Topic
    Export(String,Object) Method
    In This Topic
    Copy the image data for external access, controlled by Format and Quality
    Syntax
    'Declaration
     
    
    Public Overloads Function Export( _
       ByVal Format As System.String, _
       ByVal Quality As System.Object _
    ) As System.Byte()
    'Usage
     
    
    Dim instance As DicomImage
    Dim Format As System.String
    Dim Quality As System.Object
    Dim value() As System.Byte
     
    value = instance.Export(Format, Quality)
    public System.byte[] Export( 
       System.string Format,
       System.object Quality
    )
    public function Export( 
        Format: System.String;
        Quality: System.TObject
    ): System.array of Byte; 
    public function Export( 
       Format : System.String,
       Quality : System.Object
    ) : System.byte[];
    public: System.byte[]* Export( 
       System.string* Format,
       System.Object* Quality
    ) 
    public:
    System.array<byte>^ Export( 
       System.String^ Format,
       System.Object^ Quality
    ) 

    Parameters

    Format

    The type of export operation to perform

    Quality

    The quality factor to be used. This is a generic compression quality depending on the Transfer Syntax used. This can be an integer that specifies the value stored in the System.Drawing.Imaging.EncoderParameter object for Bitmap export. This value for JPEG Baseline and JPEG Extended compression represents an integer between 0 – 100. This tells DicomObjects to set up the compressor to try to achieve the quality in percentage (higher quality value towards 100 means better quality and lower compression ratio). And for JPEG-LS Lossy and JPEG2000 Lossy compression this value is actually the desired compression ratio, i.e. if you set the quality value to 10, it tells DicomObjects to try to achieve compression ratio of 10. The actual compression ratio achieved will not be exactly the same as specified by quality value but close enough. The actual compression ratio is calculated based on the original data size and the compressed data size before it is added to “Lossy Image Compression Ratio” tag of the image. For Video compression, this value directly corresponds to the BitsPerSecond of the compressed video.

    Return Value

    byte array containing the exported version
    Remarks

    Only JPEG and BMP/DIB formats are supported directly, but other formats such as TIF may be supported via deveoloper supplied codecs.

    The following applies to JPEG file import:

    The Format parameter must be JPEG or JPG

    The following applies to DIB/BMP file export:

    Data will be uncompressed.
    If format is BMP, then a BMP file header is included at the start of the data. If type is DIB, then no header is included.
    The Format parameter must be DIB or BMP

    See for details of how to write and configure your own codecs.

    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also