VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.ImageProcessing.Color Namespace / ColorTransformCommand Class
    Класс ColorTransformCommand
    В этом разделе
    Применяет ColorTransform к изображению.
    Объектная модель
    ColorTransform BitmapChannelsFormat BitmapChannelsFormat ProcessingCommandResults ColorTransformCommand
    Синтаксис
    'Declaration
    
    Public Class ColorTransformCommand
       Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    
    
    public class ColorTransformCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    
    
    public __gc class ColorTransformCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase*
    
    
    public ref class ColorTransformCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase^
    
    
    Ремарки

    эта команда поддерживает изображения с PixelFormat.неопределенным форматом пикселей (N-каналы и M-биты на канал).

    Пример

    Вот C#/VB.NET код, который демонстрирует, как преобразовать цвета изображения RGB с использованием указанного выходного профиля ICC.

    
    ''' <summary>
    ''' Applies a color transform command to specified VintasoftImage
    ''' using specified output RGB profile.
    ''' </summary>
    Public Shared Sub ApplyColorTransformCommand(image As Vintasoft.Imaging.VintasoftImage, outputRgbProfile As Vintasoft.Imaging.ColorManagement.Icc.IccProfile)
        ' create new color management decoding settings
        Dim colorManagement As New Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings()
        ' set output RGB profile
        colorManagement.OutputRgbProfile = outputRgbProfile
        ' get color transform
        Dim colorTransform As Vintasoft.Imaging.ColorManagement.ColorTransform = colorManagement.GetColorTransform(Vintasoft.Imaging.ColorSpaceFormats.Bgr, Vintasoft.Imaging.ColorSpaceFormats.Bgr)
        ' create a color transform command
        Dim colorTransformCommand As New Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand()
        ' set color transform
        colorTransformCommand.ColorTransform = colorTransform
        ' apply color transform command
        colorTransformCommand.ExecuteInPlace(image)
    End Sub
    
    
    
    /// <summary>
    /// Applies a color transform command to specified VintasoftImage
    /// using specified output RGB profile.
    /// </summary>
    public static void ApplyColorTransformCommand(
        Vintasoft.Imaging.VintasoftImage image,
        Vintasoft.Imaging.ColorManagement.Icc.IccProfile outputRgbProfile)
    {
        // create new color management decoding settings
        Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings colorManagement =
            new Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings();
        // set output RGB profile
        colorManagement.OutputRgbProfile = outputRgbProfile;
        // get color transform
        Vintasoft.Imaging.ColorManagement.ColorTransform colorTransform =
            colorManagement.GetColorTransform(
                Vintasoft.Imaging.ColorSpaceFormats.Bgr,
                Vintasoft.Imaging.ColorSpaceFormats.Bgr
            );
        // create a color transform command
        Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand colorTransformCommand =
            new Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand();
        // set color transform
        colorTransformCommand.ColorTransform = colorTransform;
        // apply color transform command
        colorTransformCommand.ExecuteInPlace(image);
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
          Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также