CreateImageBasedOnSourceImageDecoder(VintasoftImage) Method (VintasoftImage)
Creates a new image that is based on the decoder of the source image.
Parameters
- 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 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();
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5