←Select platform

ImageRegion Property

Summary
This property is updated with a shallow copy of the image that also has a region that contains the removed inverted text.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public RasterImage ImageRegion { get; } 
@property (nonatomic, strong, readonly, nullable) LTRasterImage *imageRegion; 
public RasterImage getImageRegion(); 
public: 
property RasterImage^ ImageRegion { 
   RasterImage^ get(); 
} 
ImageRegion # get  (InvertedTextCommand) 

Property Value

A shallow copy of the image that also has a region that contains the removed inverted text.

Remarks

If InvertedTextCommandFlags.SingleRegion| InvertedTextCommandFlags.LeadRegion has been set in the Flags property, then when InvertedTextCommand returns, this property is updated with a shallow copy of the image that also has a region that contains the removed inverted text. So set the InvertedTextCommandFlags.SingleRegion| InvertedTextCommandFlags.LeadRegion flags. Dispose of the region when it is no longer needed.

Example

Run the InvertedTextCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void ImageRegionPropertyExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif")); 
 
   // Prepare the command 
   InvertedTextCommand command = new InvertedTextCommand(); 
   command.InvertedText += new EventHandler<InvertedTextCommandEventArgs>(InvertedTextEvent_S3); 
   command.Flags = InvertedTextCommandFlags.UseDpi | InvertedTextCommandFlags.SingleRegion | InvertedTextCommandFlags.LeadRegion; 
   command.MaximumBlackPercent = 95; 
   command.MinimumBlackPercent = 70; 
   command.MinimumInvertHeight = 500; 
   command.MinimumInvertWidth = 5000; 
   command.Run(image); 
 
} 
 
private void InvertedTextEvent_S3(object sender, InvertedTextCommandEventArgs e) 
{ 
   MessageBox.Show("Size " + "( " + e.BoundingRectangle.Left + ", " + e.BoundingRectangle.Top + ") - " + "( " + e.BoundingRectangle.Right + ", " + e.BoundingRectangle.Bottom + ")" + 
      "\n Black Count " + e.BlackCount.ToString() + 
      "\n White Count " + e.WhiteCount.ToString()); 
   e.Status = RemoveStatus.Remove; 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.11.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.