DigitalFormEmbeddedImage.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. using System.Threading.Tasks;
  2. using InABox.Core;
  3. using InABox.Mobile;
  4. namespace PRS.Mobile
  5. {
  6. public class DigitalFormEmbeddedImage : DigitalFormEmbeddedMedia<DFLayoutEmbeddedImage, DFLayoutEmbeddedImageProperties>
  7. {
  8. protected override bool IsVideo => false;
  9. protected override bool DisableLibrary => Definition.Properties.DisableLibrary;
  10. protected override bool Secure => Definition.Properties.Secure;
  11. protected override bool Required => Definition.Properties.Required;
  12. protected override Task<MobileDocument> CaptureMedia()
  13. {
  14. return MobileDocument.From(new MobileDocumentCameraSource());
  15. }
  16. protected override Task<MobileDocument> SelectMedia()
  17. {
  18. return MobileDocument.From(new MobileDocumentPhotoLibrarySource());
  19. }
  20. protected override byte[] CreateThumbnail(byte[] data, float maxwidth = 200, float maxheight=200)
  21. {
  22. return MobileUtils.ImageTools.CreateThumbnail(data, maxwidth, maxheight);
  23. }
  24. }
  25. }