Nevron Open Vision Documentation
Nevron.Nov.Graphics Namespace / NImageService Class / EncodeRaster Method
The raster to be encoded.
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
    EncodeRaster Method
    In This Topic
    Encodes a raster image into the specified image format.
    Syntax
    'Declaration
     
    
    Public Function EncodeRaster( _
       ByVal raster As NRaster, _
       ByVal imageFormat As NImageFormat, _
       ByVal settings As NImageEncoderSettings, _
       ByVal encoderPreference As ENCodecPreference _
    ) As NImageData
    'Usage
     
    
    Dim instance As NImageService
    Dim raster As NRaster
    Dim imageFormat As NImageFormat
    Dim settings As NImageEncoderSettings
    Dim encoderPreference As ENCodecPreference
    Dim value As NImageData
     
    value = instance.EncodeRaster(raster, imageFormat, settings, encoderPreference)

    Parameters

    raster
    The raster to be encoded.
    imageFormat
    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 11, Windows 10, Windows 7, 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)

    See Also