public RasterColorConverterEngine() public:RasterColorConverterEngine();
__init__() # Default constructor using Leadtools;using Leadtools.Codecs;using Leadtools.ColorConversion;using Leadtools.ImageProcessing;public void StartupExample(){// StartUp the ColorConversion.RasterColorConverterEngine.Startup();// Input file namestring inputFileName = Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp");// Load the input image as Bgrusing (RasterCodecs codecs = new RasterCodecs())using (RasterImage bgrImage = codecs.Load(inputFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1)){// BGR bufferbyte[] bgrBuffer = new byte[bgrImage.BytesPerLine * bgrImage.Height];bgrImage.Access();bgrImage.GetRow(0, bgrBuffer, 0, bgrImage.BytesPerLine * bgrImage.Height);bgrImage.Release();// CMYK bufferbyte[] cmykBuffer = new byte[bgrImage.Height * bgrImage.Width * 4];// Start the color conversionRasterColorConverterEngine rasterColorConverterEngine = new RasterColorConverterEngine();rasterColorConverterEngine.Start(ConversionColorFormat.Bgr, ConversionColorFormat.Cmyk, null);rasterColorConverterEngine.Convert(bgrBuffer, // input buffer0, // offset from the beginning of the source buffercmykBuffer, // output buffer0, // offset from the beginning of the destination bufferbgrImage.Width, // pixels widthbgrImage.Height, // pixels heightbgrImage.BytesPerLine - (bgrImage.Width * (bgrImage.BitsPerPixel / 8)), // Scanline alignment for input buffer0); // Scanline alignment for output bufferrasterColorConverterEngine.Stop();}// Shutdown the ColorConversion.RasterColorConverterEngine.Shutdown();}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
