CompositeGridConfig

This element works similarly to the GridConfig element, but offers much more flexibility and customization.

Declaration

CompositeGridConfig element is declared as an instance of CompositeGridConfig class. Reference Aspose.OMR.Generation.Config.Elements and Aspose.OMR.Generation.Config.Enums namespaces to use CompositeGridConfig types without specifying the fully qualified namespace:

using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Enums;

The maximum number of digits in the combined response is specified in the ColumnsCount property.

A set of characters to be drawn inside bubbles is specified in the Values array.

new CompositeGridConfig() {
	ColumnsCount = 3,
	Values = new List<string>() {"U", "S", "A"}
}

Required properties

Name Type Description
ColumnsCount int The maximum number of symbols in the combined response. Each symbol is represented as a line or column of bubbles, depending on the element’s GridOrientation property.
Values List<string> Characters to be drawn inside bubbles.

Optional properties

Name Type Default value Description
Name string n/a Used as an element’s identifier in recognition results and is displayed as a label on the form.
ExtraRow string[][] n/a Each array provided in this property adds a custom line / column of bubbles at the start of the grid. Characters drawn inside these bubbles may differ from those provided in Values property.
A set of characters that will be displayed inside the bubbles of a particular line / column is defined as an array of strings. The length of the array cannot be less than the value of the ColumnsCount property. To hide certain bubbles, provide an empty string ("") at their positions.
GridAlignment AlignmentEnum AlignmentEnum.Left Horizontal grid alignment.
GridOrientation Orientation Orientation.Horizontal Element’s orientation:
  • Orientation.Horizontal - each digit is represented as a column of bubbles;
  • Orientation.Vertical - each digit is represented as a row of bubbles.
RotationAngle int 0 Rotate the element by the given degree. The following values are supported: 90, 180, 270.
HeaderType GridHeaderTypeEnum GridHeaderTypeEnum.Underline The type of the box to be displayed in front of each column / row. This box can be used for hand-writing the answer in addition to marking bubbles.
  • GridHeaderTypeEnum.Underline - draw a horizontal line.
  • GridHeaderTypeEnum.Square - draw a box.
HeaderBorderSize int 3 Border width of the box to be displayed in front of each column / row.
HeaderBorderColor Color Color.Black Border color of the box to be displayed in front of each column / row.
VerticalMargin int 0 Vertical spacing between the element’s lines, in pixels.
BubbleSize BubbleSize BubbleSize.Normal Size of bubbles.
BubbleType BubbleType BubbleType.Round Bubble style.
XPosition int n/a Set the absolute position of the GridConfig element relative to the left edge of the page.
Overrides the value of GridAlignment property.
YPosition int n/a Set the absolute position of the GridConfig element relative to the top edge of the page.
Column int 1 The number of the column where the GridConfig element will be placed. Only applicable if GridConfig is placed in a multi-column ContainerConfig element.
DisplayHint bool true Show (true) or hide (false) the label above the element.

Allowed child elements

None.

Recognition behavior

Numbers from each marked bubble are merged into a single number.

If the respondent marks more than one bubble per row / column (depending on the GridOrientation attribute), the affected CompositeGridConfig element will not be recognized and an error will be written to the recognition results.

Examples

Check out the code examples to see how CompositeGridConfig elements can be used.

Bank security word

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new CompositeGridConfig() {
					Name = "Security word",
					ColumnsCount = 8,
					Values = new List<string>() { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }
				}
			}
		}
	}
};

Bank security word

Recognition result

PASSWORD

Formula

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new CompositeGridConfig() {
					Name = "Formula",
					ColumnsCount = 5,
					Values = new List<string>() { "X", "Y" },
					ExtraRow = new string[][] {
						new string[] { "1", "2", "3", "4", "5" },
						new string[] { "", "+", "+", "+", "" },
						new string[] { "", "=", "=", "=", "" }
					}
				}
			}
		}
	}
};

Formula

Recognition result

X+Y=5

Rotated

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new CompositeGridConfig() {
					Name = "Rotated",
					ColumnsCount = 5,
					Values = new List<string>() { "1", "2", "3", "4", "5" },
					GridOrientation = Orientation.Vertical,
					RotationAngle = 90
				}
			}
		}
	}
};

Rotated