public struct IccNamedColor2 public value class IccNamedColor2 : public System.ValueType class IccNamedColor2: using Leadtools;using Leadtools.ColorConversion;using Leadtools.Codecs;public string outputIccFile = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "GetIccProfileTag", "IccNamedColor2TagType.icc");public void IccNamedColor2TagTypeExample(){// Load an ICC profilestring fileName = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "InputProfile.icc");IccProfileExtended iccProfile = new IccProfileExtended(fileName);// Define the color root namesbyte[] colorRootName1 = new byte[32];colorRootName1[0] = (byte)'a';colorRootName1[1] = (byte)'n';colorRootName1[2] = (byte)'y';colorRootName1[3] = (byte)' ';colorRootName1[4] = (byte)'n';colorRootName1[5] = (byte)'a';colorRootName1[6] = (byte)'m';colorRootName1[7] = (byte)'e';colorRootName1[8] = (byte)'1';colorRootName1[9] = (byte)0;byte[] colorRootName2 = new byte[32];colorRootName2[0] = (byte)'a';colorRootName2[1] = (byte)'n';colorRootName2[2] = (byte)'y';colorRootName2[3] = (byte)' ';colorRootName2[4] = (byte)'n';colorRootName2[5] = (byte)'a';colorRootName2[6] = (byte)'m';colorRootName2[7] = (byte)'e';colorRootName2[8] = (byte)'2';colorRootName2[9] = (byte)0;// Define color PCS coordinates, must be 3 values onlyushort[] colorPCSCoords = new ushort[3] { 1, 2, 3 };// Define the Device coordinatesushort[] colorDEVCoords = new ushort[4] { 4, 3, 2, 1 };// Define two named color dataIccNamedColor2Data[] namedColors = new IccNamedColor2Data[2];namedColors[0] = new IccNamedColor2Data(colorRootName1, colorPCSCoords, colorDEVCoords);namedColors[1] = new IccNamedColor2Data(colorRootName2, colorPCSCoords, colorDEVCoords);// Define a vendor flag.// The lower 16-bits are reserved for ICC usage, while the higher 16-bits are available to use.int vendorFlag = 0x12340000;// Define the prefix for each color name, must be 32 bytesbyte[] prefix = new byte[32];prefix[0] = (byte)'a';prefix[1] = (byte)'n';prefix[2] = (byte)'y';prefix[3] = (byte)' ';prefix[4] = (byte)'p';prefix[5] = (byte)'r';prefix[6] = (byte)'e';prefix[7] = (byte)'f';prefix[8] = (byte)'i';prefix[9] = (byte)'x';prefix[10] = (byte)0;// Define the suffix for each color name, must be 32 bytesbyte[] suffix = new byte[32];suffix[0] = (byte)'a';suffix[1] = (byte)'n';suffix[2] = (byte)'y';suffix[3] = (byte)' ';suffix[4] = (byte)'s';suffix[5] = (byte)'u';suffix[6] = (byte)'f';suffix[7] = (byte)'f';suffix[8] = (byte)'i';suffix[9] = (byte)'x';suffix[10] = (byte)0;// Create the IccNamedColor2 classIccNamedColor2 iccNamedColor2 = new IccNamedColor2(vendorFlag, prefix, suffix, namedColors);// Define the tag typeIccNamedColor2TagType namedColor2TagType = new IccNamedColor2TagType(iccNamedColor2);// Add the new tag to the ICC profileiccProfile.AddTag(namedColor2TagType, IccTag.NamedColor2Tag, IccTagTypeBase.NamedColor2TypeSignature);// Generate the new profile IDiccProfile.GenerateProfileId();// Update the ICC array with the new changesiccProfile.UpdateDataArray();// Write the ICC profile into a new fileiccProfile.GenerateIccFile(outputIccFile);}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
