To perform OMR on a document one must first generate an OmrTemplateDocument object. An OmrTemplateDocument is made up of any number of OmrTemplatePages. Omr Template pages are made up of any number of OmrTemplateGroups which contain the actual OmrTemplateMark objects.
C#
OmrTemplateDocument doc = new OmrTemplateDocument();
OmrTemplatePage page = new OmrTemplatePage(myAtalaImage);
OmrTemplateGroup group = new OmrTemplateGroup("Question 1:");
group.Marks.Add(new OmrTemplateMark("A", new System.Drawing.Rectangle(…)));
group.Marks.Add(new OmrTemplateMark("B", new System.Drawing.Rectangle(…)));
group.Marks.Add(new OmrTemplateMark("C", new System.Drawing.Rectangle(…)));
group.Marks.Add(new OmrTemplateMark("D", new System.Drawing.Rectangle(…)));
page.Groups.Add(group);
doc.Pages.Add(page);
VB.NET
Dim doc As New OmrTemplateDocument()
Dim page As New OmrTemplatePage(myAtalaImage)
Dim group As New OmrTemplateGroup("Question 1:")
group.Marks.Add(New OmrTemplateMark("A", New System.Drawing.Rectangle()))
group.Marks.Add(New OmrTemplateMark("B", New System.Drawing.Rectangle()))
group.Marks.Add(New OmrTemplateMark("C", New System.Drawing.Rectangle()))
group.Marks.Add(New OmrTemplateMark("D", New System.Drawing.Rectangle()))
page.Groups.Add(group)
doc.Pages.Add(page)
Once the OmrTemplateDocument has been created it can be saved to disk by using the OmrTemplateDocument.Save method. It can then be loaded back with the OmrTemplateDocument.Load.
C#
doc.Save(myStream);
OmrTemplateDocument doc = OmrTemplateDocument.Load(inputStream);
VB.NET
doc.Save(myStream)
Dim doc As OmrTemplateDocument = OmrTemplateDocument.Load(inputStream)
Additional Articles / Resources
INFO: Getting Started with Optical Mark Recognition (OMR) / Forms Processing
Original Article:
Q10319 - HOWTO: Create an OmrTemplateDocument