Home : Optical Mark Recognition (OMR) : Create an OmrTemplateDocument
Q10319 - HOWTO: Create an OmrTemplateDocument

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)

 

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved