Skip to content
Loading
0
  • Mushtaq M A
    0
    if you need to send large file, you have go for Background services to send Large images.
     
    or 
     
    Xam.Plugin.Media has an option to resize the image size itself. you can refer the following
     
    https://github.com/jamesmontemagno/MediaPlugin#photo--video-settings 
    0
  • 0
    If the main problem is slow uploading due to image size, you could use a type of compression that allows very high compression ratios, such as JPEG2000 (J2K). To obtain such compression with Xamarin, you could an imaging library like the LEADTOOLS Imaging Toolkit for Xamarin:
    https://www.leadtools.com/sdk/xamarin
    In addition to compression, the LEADTOOLS toolkit has recently introduced a Xamarin Camera Control that might help in simplifying the process of acquiring images from camera and processing them, check out this article for details and code samples on how to use this control:
    https://www.codeproject.com/Articles/1349139/Finally-a-Camera-Control-for-Xamarin-2
    In particular, once you have configured the foundation for this control correctly, you can set the event handler for leadCamera.PictureReceived and implement the code to process and upload the image in this handler:
    1. private void LeadCamera_PictureReceived(FrameHandlerEventArgs e)  
    2. {  
    3.    using (var codecs = new RasterCodecs())  
    4.    {  
    5.       codecs.Save(e.image, memStream, RasterImageFormat.J2k, 0);  
    6.    }  
    7.    Upload(memStream);  
    8. }  
    If you are interested in checking this out, you can find a free evaluation here:
    https://www.leadtools.com/downloads?category=main
    0