SampleTargetCommand Class (original) (raw)
Summary
Corrects color values by shifting the sample colors to the target colors. This command is available in the Imaging Pro and above toolkits.
Syntax
class SampleTargetCommand(RasterCommand):
Example
Run the SampleTargetCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
public void SampleTargetCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp"));
// Prepare the command
SampleTargetCommand command = new SampleTargetCommand();
command.SampleColor = new RasterColor(50, 100, 150);
command.TargetColor = new RasterColor(60, 90, 150);
command.Flags = SampleTargetCommandFlags.Red | SampleTargetCommandFlags.High;
command.Run(image);
codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}