public void AddTag(IccTagTypeBase tagTypeObject,int tagSignature,int tagTypeSignature)
tagTypeObject
Icc class object that contains the tag data.
tagSignature
Tag signature. For possible values refer to IccTag.
tagTypeSignature
Tag type signature. For possible values refer to IccTagTypeBase
using Leadtools;using Leadtools.ColorConversion;using Leadtools.Codecs;public string outputIccFile = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "IccProfileExtended.icc");public DateTime sysDateTime = DateTime.Now; // Get the current system datapublic void IccProfileExtendedExample(){// Define the IccProfileExtended ClassIccProfileExtended iccProfile = new IccProfileExtended();// Define the IccHeader classIccHeader header = IccHeader.Empty;// Fill the ICC header// The Illuminant, ProfileSignature, and Version are filled with the default values in the IccProfile.Empty property// The Size field will be filled automatically by the different ICC methods// These should not be changed unless the user knows what they are doing// The ProfileID which will be filled using the IccProfile.GenerateProfileId method// This method must be called at the end when the ICC Profile is completely prepared// The rest of the fields are the user's responsibilityheader.CmmID = 0x6170706C; // Any CMM IDheader.DeviceClass = IccProfileClassType.DeviceLinkClass;header.ColorSpace = IccColorspaceType.LabData;header.Pcs = IccColorspaceType.LabData;header.ProfileSignature = 0x61637370; // Any profile signatureheader.Platform = IccPlatformSignatureType.MacintoshSignature;header.Flags = IccProfileFlags.None;header.Manufacturer = 0x46464549; // Any manufacturerheader.Model = 0x0; // Any modelheader.Attributes = IccProfileMediaFlags.ColorMedia;header.RenderingIntent = IccRenderingIntentType.AbsoluteColorimetric;header.Creator = 0x46464549; // Any creator// Set the system date/time as the date/time of the ICC profileIccDateTime iccDateTime = new IccDateTime((ushort)sysDateTime.Year,(ushort)sysDateTime.Month,(ushort)sysDateTime.Day,(ushort)sysDateTime.Hour,(ushort)sysDateTime.Minute,(ushort)sysDateTime.Second);header.DateTime = iccDateTime;iccProfile.Header = header;// Create and add required tags to the extended profile// mediaBlackPointTag (needs the XYZ tag type)// Define the array of XYZ numbersIccXyzNumber[] data = new IccXyzNumber[1];data[0] = new IccXyzNumber(IccTools.FromDoubleTo2bFixed2bNumber(1.0),IccTools.FromDoubleTo2bFixed2bNumber(2.0),IccTools.FromDoubleTo2bFixed2bNumber(3.0));// Create the XYZ tag typeIccXyzTagType xyzTagType = new IccXyzTagType(data);// Insert into the profileiccProfile.AddTag(xyzTagType, IccTag.MediaBlackPointTag, IccTagTypeBase.XyzTypeSignature);// calibrationDateTimeTag// Define the tag typeIccDateTimeTagType dateTimeTagType = new IccDateTimeTagType(iccDateTime);// Insert into the profileiccProfile.AddTag(dateTimeTagType, IccTag.CalibrationDateTimeTag, IccTagTypeBase.DateTimeTypeSignature);// This method shows how to get the tag type signature of any tag in the profileint tagTypeSignature = iccProfile.GetTagTypeSignature(IccTag.MediaBlackPointTag);// This method shows how to delete a specified tagxyzTagType = (IccXyzTagType)iccProfile.DeleteTag(IccTag.MediaBlackPointTag);// This method shows how to retrieve the value of a tagdateTimeTagType = (IccDateTimeTagType)iccProfile.GetTag(IccTag.CalibrationDateTimeTag);// Generate the profileId. For the time being, it will be filled with 0'siccProfile.GenerateProfileId();// Generate the new ICC profile by updating the Data Array and then generating the fileiccProfile.UpdateDataArray();iccProfile.GenerateIccFile(outputIccFile);}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}