InvertCommand Class (original) (raw)
Summary
Inverts the colors in the specified image, giving it the appearance of a photographic negative.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTInvertCommand : LTRasterCommand
public class InvertCommand
extends RasterCommand
class InvertCommand(RasterCommand):
Example
Run the InvertCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
public void InvertCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "RGSRef.cmp"));
// Prepare the command
InvertCommand command = new InvertCommand();
//Invert the colors of the image.
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";
}