VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging Namespace / VintasoftImage Class / CreateImageBasedOnSourceImageDecoder Method
A source image.

In This Topic
    CreateImageBasedOnSourceImageDecoder Method
    In This Topic
    Creates a new image that is based on the decoder of the source image.
    Public Shared Function CreateImageBasedOnSourceImageDecoder( _
       ByVal sourceImage As VintasoftImage _
    ) As VintasoftImage
    public static VintasoftImage CreateImageBasedOnSourceImageDecoder( 
       VintasoftImage sourceImage
    public: static VintasoftImage* CreateImageBasedOnSourceImageDecoder( 
       VintasoftImage* sourceImage
    static VintasoftImage^ CreateImageBasedOnSourceImageDecoder( 
       VintasoftImage^ sourceImage


    A source image.

    Return Value

    A new image based on the decoder of the source image.
    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.
    This example 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 = 
            tempImage.DecodingSettings = 
                new Vintasoft.Imaging.Codecs.Decoders.DecodingSettings();
            tempImage.DecodingSettings.ColorManagement = colorManagement;
            return tempImage.GetAsVintasoftBitmap();

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also