Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // Example: retrieving field recognition results to send to an external application/database
  2. // KeyValuePair in "using System.Collections.Generic;"
  3. foreach (KeyValuePair<string, StringField> kpr in recog_result.GetStringFields())
  4. {
  5. // Thus you can send the recognized field values to other app/db/etc
  6. Console.WriteLine("Sending field \"{0}\" with value \"{1}\"", kpr.Key, kpr.Value.GetUtf8Value());
  7. }
  8.  
  9. // Example: storing retrieved image fields to directory "C:\Users\username\Desktop\test_images"
  10. foreach (KeyValuePair<string, ImageField> kpr in recog_result.GetImageFields())
  11. {
  12. // kpr.Value.GetValue() returns an Image object
  13. kpr.Value.GetValue().Save("C:\\Users\\Username\\Desktop\\test_images\\" + kpr.Key + ".png");
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement