Exemplo n.º 1
0
        private async void compartilhaImagemAsync(ArqImagens arqselecionado)
        {
            using (var Dialog = UserDialogs.Instance.Loading("Compartilhando...", null, null, true, MaskType.Clear))
            {
                /* if (await FileManager.ExistsAsync(arqselecionado.nome_arquivo) == false)
                 * {
                 *   await FileManager.DownloadDocumentsAsync(arqselecionado);
                 * }
                 * var file = FileManager.GetFilePathFromRoot(arqselecionado.nome_arquivo);*/
                var retorno = await RestApiHelper.DownloadFileAsync(arqselecionado.nome_arquivo_completo);

                //  var retorno = await FileManager.DownloadDocumentsAsyncshare(arqselecionado);

                Xamarin.Forms.DependencyService.Get <IFileService>().Savefile(arqselecionado.nome_arquivo, retorno, "Download");
            }
            var filePath = Xamarin.Forms.DependencyService.Get <IFileStore>().GetFilePath(arqselecionado.nome_arquivo);
            //antiga forma

            /*  var share = Xamarin.Forms.DependencyService.Get<IShare>();
             * // file = "/storage/emulated/0/Download/ImageName.jpg";
             * await share.Show("Paciente", "Exames do paciente - Pdfs", filePath);*/

            await Share.RequestAsync(new ShareFileRequest()
            {
                Title = "Exames do paciente - Pdfs",

                File = new ShareFile(filePath)
            });
        }
Exemplo n.º 2
0
        private void showZoom(ArqImagens nomeSelecionado)
        {
            try
            {
                new PhotoBrowser
                {
                    Photos = new List <Photo>
                    {
                        new Photo

                        {
                            URL = nomeSelecionado.nome_arquivo_completo,
                        },
                    },
                    ActionButtonPressed = (index) =>
                    {
                        Debug.WriteLine($"Clicked {index}");
                        PhotoBrowser.Close();
                        //  _navigationService.GoBackAsync();
                    }
                }.Show();
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 3
0
        /*  private async void showZoom(ArqImagens nomeSelecionado)
         * {
         *    List<Photo> _photo = new List<Photo>();
         *    string caminho = Path.Combine(FileSystem.CacheDirectory, "teste.jpg");
         *    // NavigationService.NavigateAsync("LoginPacientePage");
         *    // teste(nomeSelecionado);
         *    _photo = await grava_local(nomeSelecionado);
         *    try
         *    {
         *
         *
         *    new PhotoBrowser
         *    {
         *        Photos = _photo.ToList(),
         *
         *
         *
         *        ActionButtonPressed = (index) =>
         *        {
         *            Debug.WriteLine($"Clicked {index}");
         *            PhotoBrowser.Close();
         *
         *            //  _navigationService.GoBackAsync();
         *        }
         *
         *    }.Show();
         *    }
         *    catch(Exception ex)
         *    {
         *
         *    }
         *
         * }
         *
         *
         * private async Task<List<Photo>> grava_local(ArqImagens nomeSelecionado)
         * {
         *    string caminho = "";
         *    List<Photo> _photo = new List<Photo>();
         *    for (int i = 0; i < nomeSelecionado.lista_jpeg.Count(); i++)
         *    {
         *        caminho = Path.Combine(FileSystem.CacheDirectory, "teste" + i + ".jpg");
         *        var foto = new Photo();
         *
         *        foto.URL = nomeSelecionado.lista_jpeg[i].ToString().Replace(" ", "%20");
         *        //foto.URL = nomeSelecionado.lista_jpeg[i];
         *        var retorno = await apiService.DownloadFileAsync(foto.URL);
         *        File.WriteAllBytes(caminho, retorno.ToArray());
         *        foto.Title = "teste" + i + ".jpg";
         *        foto.URL = caminho;
         *        _photo.Add(foto);
         *
         *    }
         *    return _photo;
         * }*/
        /*private void showZoom(ArqImagens nomeSelecionado)
         * {
         *            try
         *            {
         *                new PhotoBrowser
         *                {
         *                    Photos = new List<Photo>
         *        {
         *            new Photo
         *            {
         *                URL = "https://www.painelstudio.com/perboyre/exames/687014-ERICA_GONCALVES_GOMES/687014pa.jpg",
         *                Title = "Vincent"
         *            },
         *            new Photo
         *            {
         *                URL = "https://www.painelstudio.com/perboyre/exames/685593-ISADORA_REIS_FRANCO/pdf/685593L/teste.jpg",
         *                Title = "Vincent"
         *            },
         *            new Photo
         *            {
         *                URL = nomeSelecionado.nome_arquivo_completo,
         *                Title = "Jules"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Korben.jpg",
         *                Title = "Korben"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Toretto.jpg",
         *                Title = "Toretto"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Marty.jpg",
         *                Title = "Marty"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Driver.jpg",
         *                Title = "Driver"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Frank.jpg",
         *                Title = "Frank"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Max.jpg",
         *                Title = "Max"
         *            },
         *            new Photo
         *            {
         *                URL = "https://raw.githubusercontent.com/stfalcon-studio/FrescoImageViewer/v.0.5.0/images/posters/Daniel.jpg",
         *                Title = "Daniel"
         *            }
         *        },
         *                    ActionButtonPressed = (index) =>
         *                    {
         *                        Debug.WriteLine($"Clicked {index}");
         *                        PhotoBrowser.Close();
         *                    },
         *
         *
         *
         *
         *                }.Show();
         *            }
         *            catch(Exception e)
         *            {
         *
         *            }
         *
         *
         *
         * }*/
        private async void teste(ArqImagens nomeSelecionado)
        {
            var navigationParams = new NavigationParameters();

            navigationParams.Add("imagem", nomeSelecionado);
            await NavigationService.NavigateAsync("TesteImagem", navigationParams);

            // await Navigation.PushAsync(new TesteImagem());
        }
Exemplo n.º 4
0
        private void showZoom(ArqImagens nomeSelecionado)
        {
            try
            {
                List <Photo> _photo = new List <Photo>();

                // NavigationService.NavigateAsync("LoginPacientePage");
                // teste(nomeSelecionado);
                for (int i = 0; i < nomeSelecionado.lista_jpeg.Count(); i++)
                {
                    var foto = new Photo();

                    foto.URL = nomeSelecionado.lista_jpeg[i].ToString().Replace(" ", "%20");
                    //foto.URL = nomeSelecionado.lista_jpeg[i];
                    _photo.Add(foto);
                }
                // var retorno = await apiService.DownloadFileAsync(nome_arquivo_completo);
                new PhotoBrowser
                {
                    Photos = _photo,



                    ActionButtonPressed = (index) =>
                    {
                        Debug.WriteLine($"Clicked {index}");
                        PhotoBrowser.Close();

                        //  _navigationService.GoBackAsync();
                    }
                }.Show();
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
        }
Exemplo n.º 5
0
 public override void OnNavigatedTo(INavigationParameters parameters)
 {
     _paciente = (ArqImagens)parameters["paciente"];
     getPdfFile();
 }