LEADTOOLS Color Conversion (Leadtools.ColorConversion assembly)
LEAD Technologies, Inc

InputProfile Property

Example 





Gets or sets a character string that contains the input profile name, used with the ConversionMethodFlags.UseCustomIcc active conversion method. .NET support
Syntax
public string InputProfile {get; set;}
'Declaration
 
Public Property InputProfile As String
'Usage
 
Dim instance As ConversionParameters
Dim value As String
 
instance.InputProfile = value
 
value = instance.InputProfile
public string InputProfile {get; set;}
 get_InputProfile();
set_InputProfile(value);
public:
property String^ InputProfile {
   String^ get();
   void set (    String^ value);
}

Property Value

Character string that contains the input file name used with the ConversionMethodFlags.ConversionMethodFlags.UseCustomIcc active conversion method (ActiveMethod property).
Example
Copy CodeCopy Code  
Public Sub InputProfilePropertyExample()
      ' StartUp the ColorConversion. 
      RasterColorConverterEngine.Startup()

      ' Rgb and Cmyk color buffer arrays 
      Dim rgbColor As Byte() = New Byte(2) {}
      Dim cmykColor As Byte() = {100, 100, 100, 100}

      ' Initialize a new ConversionParameters class object. 
      Dim convParams As ConversionParameters = New ConversionParameters()

      ' Set the Method property 
      convParams.Method = ConversionMethodFlags.UseIcc Or ConversionMethodFlags.UseBuiltIn

      ' Set the ActiveMethod property. 
      convParams.ActiveMethod = ConversionMethodFlags.UseBuiltIn

      ' Initialize the White property class 
      Dim whitePoint As ConversionWhitePoint = New ConversionWhitePoint()

      ' Set the WhitePoint property 
      whitePoint.WhitePoint = ConversionWhitePointType.D50
      convParams.WhitePoint = whitePoint

      ' Set the InputProfile property 
      convParams.InputProfile = Path.Combine(LEAD_VARS.ImagesDir, "MyCmykProfile.icm")

      ' Set the OutputProfile property 
      convParams.OutputProfile = Path.Combine(LEAD_VARS.ImagesDir, "MyRgbProfile.icm")

      ' Set the DestinationInputTable property 
      convParams.DestinationInputTable = String.Empty
      Dim cmykParameters As ConversionCmykParameters = New ConversionCmykParameters()
      cmykParameters.GcrLevel = 175
      cmykParameters.Mask = ConversionCmykMask.Gcr
      convParams.CmykParameters = cmykParameters


      ' Initialize a new Converter object 
      Dim MYColorConverter As RasterColorConverterEngine = New RasterColorConverterEngine()

      Try
         ' Start conversion 
         MYColorConverter.Start(ConversionColorFormat.Cmyk, ConversionColorFormat.Rgb, convParams)

         ' Convert the cmyk color to rgb 
         MYColorConverter.Convert(cmykColor, 0, rgbColor, 0, 1, 1, 0, 0)

         'change the active method for conversion
         convParams.Method = ConversionMethodFlags.ChangeActiveMethod

         'switch to ICC conversion method
         convParams.ActiveMethod = ConversionMethodFlags.UseIcc

         'update the conversion state
         MYColorConverter.SetParameters(convParams)

         ' convert the image buffer  
         MYColorConverter.Convert(cmykColor, 0, rgbColor, 0, 1, 1, 0, 0)

         ' Stop conversion  
         MYColorConverter.Stop()
      Catch ex As Exception
         MessageBox.Show(ex.Message)
      End Try

      RasterColorConverterEngine.Shutdown()
   End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void InputProfilePropertyExample()
   {
      // StartUp the ColorConversion. 
      RasterColorConverterEngine.Startup();

      // Rgb and Cmyk color buffer arrays 
      byte[] rgbColor = new byte[3];
      byte[] cmykColor = { 100, 100, 100, 100 };

      // Initialize a new ConversionParameters class object. 
      ConversionParameters convParams = new ConversionParameters();

      // Set the Method property 
      convParams.Method = ConversionMethodFlags.UseIcc | ConversionMethodFlags.UseBuiltIn;

      // Set the ActiveMethod property. 
      convParams.ActiveMethod = ConversionMethodFlags.UseBuiltIn;

      // Initialize the White property class 
      ConversionWhitePoint whitePoint = new ConversionWhitePoint();

      // Set the WhitePoint property 
      whitePoint.WhitePoint = ConversionWhitePointType.D50;
      convParams.WhitePoint = whitePoint;

      // Set the InputProfile property 
      convParams.InputProfile = Path.Combine(LEAD_VARS.ImagesDir, "MyCmykProfile.icm");

      // Set the OutputProfile property 
      convParams.OutputProfile = Path.Combine(LEAD_VARS.ImagesDir, "MyRgbProfile.icm");

      // Set the DestinationInputTable property 
      convParams.DestinationInputTable = string.Empty;
      ConversionCmykParameters cmykParameters = new ConversionCmykParameters();
      cmykParameters.GcrLevel = 175;
      cmykParameters.Mask = ConversionCmykMask.Gcr;
      convParams.CmykParameters = cmykParameters;


      // Initialize a new Converter object 
      RasterColorConverterEngine MYColorConverter = new RasterColorConverterEngine();

      try
      {
         // Start conversion 
         MYColorConverter.Start(ConversionColorFormat.Cmyk, ConversionColorFormat.Rgb, convParams);

         // Convert the cmyk color to rgb 
         MYColorConverter.Convert(cmykColor, 0, rgbColor, 0, 1, 1, 0, 0);

         //change the active method for conversion
         convParams.Method = ConversionMethodFlags.ChangeActiveMethod;

         //switch to ICC conversion method
         convParams.ActiveMethod = ConversionMethodFlags.UseIcc;

         //update the conversion state
         MYColorConverter.SetParameters(convParams);

         // convert the image buffer  
         MYColorConverter.Convert(cmykColor, 0, rgbColor, 0, 1, 1, 0, 0);

         // Stop conversion  
         MYColorConverter.Stop();
      }
      catch (Exception ex)
      {
         MessageBox.Show(ex.Message);
      }

      RasterColorConverterEngine.Shutdown();
   }


static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ConversionParameters Class
ConversionParameters Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.