PhotoUtils.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using Comal.Classes;
  2. using InABox.Configuration;
  3. using InABox.Mobile;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. namespace PRS.Mobile
  8. {
  9. public static class PhotoUtils
  10. {
  11. public static MobileDocumentCameraOptions CreateCameraOptions()
  12. {
  13. var photoSettings = new GlobalConfiguration<MobilePhotoSettings>().Load();
  14. return new MobileDocumentCameraOptions()
  15. {
  16. Compression = photoSettings.PhotoCompression,
  17. Constraints = new System.Drawing.Size(photoSettings.MaxPhotoWidth, photoSettings.MaxPhotoHeight)
  18. };
  19. }
  20. public static MobileDocumentPhotoLibraryOptions CreatePhotoLibraryOptions()
  21. {
  22. var photoSettings = new GlobalConfiguration<MobilePhotoSettings>().Load();
  23. return new MobileDocumentPhotoLibraryOptions()
  24. {
  25. Compression = photoSettings.PhotoCompression,
  26. Constraints = new System.Drawing.Size(photoSettings.MaxPhotoWidth, photoSettings.MaxPhotoHeight)
  27. };
  28. }
  29. }
  30. }