Пример #1
0
        public void downloadlogo(SVC.ServiceCliniqueClient proxyrecu)
        {
            Dispatcher.BeginInvoke(new Action(() => {
                if (checkBoxImage.IsChecked == true)
                {
                    var image = LoadImage(proxy.DownloadDocument(proxyrecu.GetAllParamétre().CheminLogo.ToString()));
                    JpegBitmapEncoder encoder = new JpegBitmapEncoder();
                    Guid photoID         = System.Guid.NewGuid();
                    String photolocation = System.Environment.CurrentDirectory + "/Logo.png";
                    encoder.Frames.Add(BitmapFrame.Create((BitmapImage)image));
                    using (var filestream = new FileStream(photolocation, FileMode.Create))
                        encoder.Save(filestream);
                    //System.Windows.MessageBox.Show((proxy.DownloadDocumentIsHere(proxy.GetAllParamétre().logo.ToString())).ToString());
                }
            }), DispatcherPriority.SystemIdle);

            //   Thread.();
        }