Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Convert RGB To CMYK
Started by dgVisioscopie at 03-06-2008 7:08. Topic has 1 replies.

Print Search « Previous Thread Next Thread »
  03-06-2008, 7:08
dgVisioscopie is not online. Last active: 3/6/2008 1:06:07 PM dgVisioscopie

Top 500 Posts
Joined on 01-24-2006
Posts 10
Convert RGB To CMYK
Reply Quote
Hello,
I'm using LeadTools 15 with C#.
I have an RGB image. Before printing this image, i want to convert it to CMYK, by using an ICC profile.

I can do a conversion of an image with the original profiles of Leadtools, but when I want to use a custom ICC profile, I can't because the method
"converter.Start" raises an exception with a message "Invalid parameter passed".


I took example of the InputProfilePropertyExample:

When I copy, paste it and execute the code with two ICC profiles of mine, it generates me a RasterException.

public void InputProfilePropertyExample()
{
// StartUp the ColorConversion.
RasterColorConverter.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.UseCustomIcc;

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

// Initialize the White property class
ConversionWhitePoint whitePoint = ConversionWhitePoint.Empty;

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

// Set the InputProfile property
convParams.InputProfile = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MyCmykProfile.icm";

// Set the InputProfileData property
convParams.InputProfileData = null;

// Set the OutputProfile property
convParams.OutputProfile = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\MyRgbProfile.icm";

// Set the OutputProfileData property
convParams.OutputProfileData = null;

// Set the DestinationInputTable property
convParams.DestinationInputTable = string.Empty;

// Initialize a new Converter object
RasterColorConverter converter = new RasterColorConverter();

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

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

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

//.
//.
//.
// use rgbColor as you need.

// Shutdown the ColorConversion.
RasterColorConverter.Shutdown();
}


Replacing the two Leadtools examples profiles (MyRgbProfile.icm and MyCmykProfile.icm) by 2 of mine, executing the method "converter.Start(...)", I always catch an exception, with my profiles and the one of Leadtools or any other profile.

Do you have some proposition?
Thank you.

David
   Report 
  03-06-2008, 13:52
GregR is not online. Last active: 10/10/2008 11:46:18 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,621
Re: Convert RGB To CMYK
Reply Quote
Please send the two ICC profiles you're using so I can try to reproduce the problem on my end.

NOTE: If you are attaching a project or file to the forums...
1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.  If it is larger, please send an email to support@leadtools.com and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
 
If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to support@leadtools.com and make sure that you include a link to this forum post.


Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Color Conversio... » Re: Convert RGB To CMYK

Powered by Community Server, by Telligent Systems