Specifies the different options for a Form page when it is added to a
form using
AddFormPage
for Forms or
AddMasterFormPage
for Master Forms.
Syntax
Example
This example adds a page image to an attributes.
Visual Basic | Copy Code |
---|
Public Sub AddPageToFormAttributes(ByVal page As RasterImage, ByVal attributes As FormRecognitionAttributes, ByVal engine As FormRecognitionEngine)
Dim pageOptions As PageRecognitionOptions = New PageRecognitionOptions()
pageOptions.AutoCleanUp = True
pageOptions.UpdateImage = True
pageOptions.IncludeRectangles.Add(New LogicalRectangle(0, 0, page.Width, page.Height, LogicalUnit.Pixel))
pageOptions.ExcludeRectangles.Add(New LogicalRectangle(page.Width * 6 / 10, page.Height * 4 / 10, page.Width * 3 / 10, page.Height * 2 / 10, LogicalUnit.Pixel))
pageOptions.RegionOfInterestRectangles.Add(New LogicalRectangle(page.Width * 1 / 10, page.Height * 1 / 10, page.Width * 2 / 10, page.Height * 2 / 10, LogicalUnit.Pixel))
Dim properties As FormRecognitionProperties = engine.GetFormProperties(attributes)
If properties.IsMaster Then
engine.OpenMasterForm(attributes)
engine.AddMasterFormPage(attributes, page, pageOptions)
engine.CloseMasterForm(attributes)
Else
engine.OpenForm(attributes)
engine.AddFormPage(attributes, page, pageOptions)
engine.CloseForm(attributes)
End If
End Sub
|
C# | Copy Code |
---|
///This method add a page to the form attributes. public void AddPageToFormAttributes(RasterImage page, FormRecognitionAttributes attributes, FormRecognitionEngine engine) { PageRecognitionOptions pageOptions = new PageRecognitionOptions(); pageOptions.AutoCleanUp = true; pageOptions.UpdateImage = true; pageOptions.IncludeRectangles.Add(new LogicalRectangle(0, 0, page.Width, page.Height, LogicalUnit.Pixel)); pageOptions.ExcludeRectangles.Add(new LogicalRectangle(page.Width * 6 / 10, page.Height * 4 / 10, page.Width * 3 / 10, page.Height * 2 / 10, LogicalUnit.Pixel)); pageOptions.RegionOfInterestRectangles.Add(new LogicalRectangle(page.Width * 1 / 10, page.Height * 1 / 10, page.Width * 2 / 10, page.Height * 2 / 10, LogicalUnit.Pixel)); FormRecognitionProperties properties = engine.GetFormProperties(attributes); if(properties.IsMaster) { engine.OpenMasterForm(attributes); engine.AddMasterFormPage(attributes, page, pageOptions); engine.CloseMasterForm(attributes); } else { engine.OpenForm(attributes); engine.AddFormPage(attributes, page, pageOptions); engine.CloseForm(attributes); } } |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also