VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging Namespace / VintasoftImage Class / CreateImageBasedOnSourceImageDecoder(VintasoftImage) Method
Syntax Remarks Example Requirements SeeAlso
In This Topic
    CreateImageBasedOnSourceImageDecoder(VintasoftImage) Method (VintasoftImage)
    In This Topic
    Creates a new image that is based on the decoder of the source image.
    Syntax
    'Declaration
    
    Public Shared Function CreateImageBasedOnSourceImageDecoder( _
    ByVal sourceImage
    A source image.
    As VintasoftImage _
    ) As VintasoftImage
    public static VintasoftImage CreateImageBasedOnSourceImageDecoder(
    VintasoftImage sourceImage
    )
    public: static VintasoftImage* CreateImageBasedOnSourceImageDecoder(
    VintasoftImage* sourceImage
    )
    public:
    static VintasoftImage^ CreateImageBasedOnSourceImageDecoder(
    VintasoftImage^ sourceImage
    )

    Parameters

    sourceImage
    A source image.

    Return Value

    A new image based on the decoder of the source image.
    Remarks

    This method can be used when the same VintasoftImage must be used with different decoding (color management) settings.

    Created image must be destroyed using the Dispose method when image is not necessary any more.

    Example

    This C#/VB.NET code shows how to get the bitmap, from the VintasoftImage object, with the decoding settings different from the decoding settings of the VintasoftImage object.

    
    ''' <summary>
    ''' Returns a bitmap from image with specified color management settings.
    ''' </summary>
    Public Function GetVintasoftBitmap(image As Vintasoft.Imaging.VintasoftImage, colorManagement As Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings) As Vintasoft.Imaging.VintasoftBitmap
        Using tempImage As Vintasoft.Imaging.VintasoftImage = Vintasoft.Imaging.VintasoftImage.CreateImageBasedOnSourceImageDecoder(image)
            tempImage.DecodingSettings = New Vintasoft.Imaging.Codecs.Decoders.DecodingSettings()
            tempImage.DecodingSettings.ColorManagement = colorManagement
            Return tempImage.GetAsVintasoftBitmap()
        End Using
    End Function
    
    
    
    /// <summary>
    /// Returns a bitmap from image with specified color management settings.
    /// </summary>
    public Vintasoft.Imaging.VintasoftBitmap GetVintasoftBitmap(
        Vintasoft.Imaging.VintasoftImage image,
        Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings colorManagement)
    {
        using (Vintasoft.Imaging.VintasoftImage tempImage = 
            Vintasoft.Imaging.VintasoftImage.CreateImageBasedOnSourceImageDecoder(image))
        {
            tempImage.DecodingSettings = 
                new Vintasoft.Imaging.Codecs.Decoders.DecodingSettings();
            tempImage.DecodingSettings.ColorManagement = colorManagement;
            return tempImage.GetAsVintasoftBitmap();
        }
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also