[FlagsAttribute()]
public enum InvertedPageCommandFlags
typedef NS_OPTIONS(NSUInteger, LTInvertedPageCommandFlags)
public final class InvertedPageCommandFlags
extends java.lang.Enum<InvertedPageCommandFlags>
[FlagsAttribute()]
public enum class InvertedPageCommandFlags
class InvertedPageCommandFlags(Enum):
None = 0
None = 0
Process, NoProcess = 1
Process, ExcludeBorder = 2
Process, UseZones = 4
Value | Member | Description |
---|---|---|
0x00000000 | None | Default value. Checks and corrects the image if it is inverted. This is the same as specifying the Process flag. |
0x00000000 | Process | Checks and corrects the image if it is inverted. The InvertedPageCommand.IsInverted will be set to true if the command inverted the image, false; otherwiseThis flag cannot be used with NoProcess. |
0x00000001 | NoProcess | Only determine whether the image is inverted but do not change the image data. The InvertedPageCommand.IsInverted will be set to true if the image is inverted; otherwise, falseThis flag cannot be used with Process. |
0x00000002 | ExcludeBorder | Excludes White or Black borders from the calculations. |
0x00000004 | UseZones | An advanced version that is able to detect figure images before inverting them. This option is slower than the other options.This flag cannot be used with ExcludeBorder. |
You can use a bitwise OR ( | ) to specify one or more flags.
The InvertedPageCommand enumeration is used as the type for the InvertedPageCommand.Flags property.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
public void InvertedPageCommandExample()
{
RasterCodecs codecs = new RasterCodecs();
// Get an image
string tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif");
string invertedImageFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1_Inverted.tif");
string nonInvertedImageFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1_NonInverted.tif");
RasterImage image = codecs.Load(tifFileName);
// The images should be non-inverted at the beginning, check
InvertedPageCommand invertedPage = new InvertedPageCommand(InvertedPageCommandFlags.NoProcess);
invertedPage.Run(image);
Console.WriteLine("Original image, inverted = {0}", invertedPage.IsInverted);
// Invert the image
InvertCommand invert = new InvertCommand();
invert.Run(image);
codecs.Save(image, invertedImageFileName, image.OriginalFormat, image.BitsPerPixel);
// Check again
invertedPage.Run(image);
Console.WriteLine("After running InvertCommand, inverted = {0}", invertedPage.IsInverted);
// Now run the command to un-invert the image
invertedPage.Flags = InvertedPageCommandFlags.Process;
invertedPage.Run(image);
// Now check the image again
invertedPage.Flags = InvertedPageCommandFlags.NoProcess;
invertedPage.Run(image);
Console.WriteLine("After running InvertedPageCommand, inverted = {0}", invertedPage.IsInverted);
codecs.Save(image, nonInvertedImageFileName, image.OriginalFormat, image.BitsPerPixel);
image.Dispose();
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.