Nevron Open Vision Documentation
Nevron.Nov.Graphics Namespace / NRaster Class / Encode Method / Encode(NImageFormat,NImageEncoderSettings,ENCodecPreference) Method
Specifies the target image format. Cannot be null.
An object that specifies format-specific settings for the image encoder. The target format and the settings type must match. For example in order to encode the image into PNG format you have to pass NImageFormat.Png as imageFormat and an instance of the NPngEncoderSettings type as settings. If this parameter is set to null, the default encoder settings will be used.
Specifies preference for the image encoder.


In This Topic
    Encode(NImageFormat,NImageEncoderSettings,ENCodecPreference) Method
    In This Topic
    Encodes the raster to the specified image format.
    Syntax
    'Declaration
     
    
    Public Overloads Function Encode( _
       ByVal imageFormat As NImageFormat, _
       ByVal settings As NImageEncoderSettings, _
       ByVal encoderPreference As ENCodecPreference _
    ) As NImageData
    'Usage
     
    
    Dim instance As NRaster
    Dim imageFormat As NImageFormat
    Dim settings As NImageEncoderSettings
    Dim encoderPreference As ENCodecPreference
    Dim value As NImageData
     
    value = instance.Encode(imageFormat, settings, encoderPreference)

    Parameters

    imageFormat
    Specifies the target image format. Cannot be null.
    settings
    An object that specifies format-specific settings for the image encoder. The target format and the settings type must match. For example in order to encode the image into PNG format you have to pass NImageFormat.Png as imageFormat and an instance of the NPngEncoderSettings type as settings. If this parameter is set to null, the default encoder settings will be used.
    encoderPreference
    Specifies preference for the image encoder.

    Return Value

    Returns an object containing the encoded image data.
    Remarks
    The method throws an exception if it fails to encode the raster.
    Requirements

    Target Platforms: Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also