static void DownloadProgress(object sender, DownloadProgressEventArgs e) { var picture = GetPicture (sender as DependencyObject); if (picture != null) { picture.DownloadProgressValue = e.Progress; picture.DownloadProgressVisibility = e.Progress < 100 ? Visibility.Visible : Visibility.Collapsed ; } }
public void OnSourceDownloadProgress(object sender, DownloadProgressEventArgs e) { BitmapFrameDecode clone = this.Target as BitmapFrameDecode; if (null != clone) { clone.OnDownloadProgress(sender, e); } else { DetachSourceDownloadHandlers(); } }
private void OnProgress(object s, DownloadProgressEventArgs args) { if (args.Progress != 100) return; Dispatcher.BeginInvoke(() => { var img = ImageHolder.FindName("dinamycImage") as Image; if (img != null) HtmlPage.Window.CreateInstance("xHeight", String.Format("{0}px", img.ActualHeight + 40)); }); _bitmapImage.DownloadProgress -= OnProgress; }
private void ImageDownloadProgress(object sender, DownloadProgressEventArgs args) { if (args.Progress < 100) return; Photos.SelectedIndex = -1; viewModel.image.DownloadProgress -= ImageDownloadProgress; viewModel.IsDataLoaded = true; HideProgress(); Serializer.Save("photo.view", viewModel.SelectedPhoto); using (var s = PlatformFileAccess.GetSaveFileStream("photo.jpg")) { var bmp = new WriteableBitmap(viewModel.image); bmp.SaveJpeg(s, viewModel.image.PixelWidth, viewModel.image.PixelHeight, 0, 100); } NavigationService.Navigate(new Uri("/Views/PhotoView.xaml", UriKind.Relative)); }
/// <summary> /// 下载图片进度 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void bitmapImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (e.Progress == 100) { BitmapImage bitmapImage = sender as BitmapImage; int height = bitmapImage.PixelHeight; int width = bitmapImage.PixelWidth; //当下载的图片有效时 if (height > 0 && width > 0) { if (width > bitmapImage.PixelHeight) CurImage.Width = (width < CurImage.MaxWidth) ? width : CurImage.MaxWidth; else CurImage.Height = (height < CurImage.MaxHeight) ? height : CurImage.MaxHeight; //SetPositionInfo(height, width); LoadInfo.Visibility = System.Windows.Visibility.Collapsed; CurImageFadeIn.Begin(); } else //不存在或路径无效时 { //CurImage.Source = new BitmapImage(new Uri("/Images/NoPhoto.jpg", UriKind.RelativeOrAbsolute)); //CurImage.Width = 142; //CurImage.Height = 119; LoadInfo.Content = "图片信息无效!"; } } else { LoadInfo.Content = "正在加载数据" + e.Progress + "..."; } }
void bmpImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { double value = (double)e.Progress / 100; lastCurrentItemDownloadProgress = value; DownloadProgress = value; if (value >= 1) { IsDownloading = false; clearPopupPreviousItem(); if (IsPlaying) { lastTick = DateTime.Now; slideShowTimer.Start(); } } else if (value > 0) { IsDownloading = true; } }
private void OnSourceDownloadProgress(object sender, DownloadProgressEventArgs e) { _progressEvent.InvokeEvents(this, e); }
void bi_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (onProgress != null) onProgress(e.Progress); }
private void bitmap_DownloadProgress(object sender, DownloadProgressEventArgs e, Image img, EventHandler<DownloadProgressEventArgs> onProgressEventHandler, int id) { if (id != this.requestID) { if (img.Parent != null) { (img.Parent as Panel).Children.Remove(img); } } else { int progress = e.Progress; if ((sender as BitmapImage).UriSource.OriginalString != null) { if (e.Progress == 100) { (sender as BitmapImage).DownloadProgress -= onProgressEventHandler; this.ShowImage(img); } this.OnProgress(e.Progress); } } }
void image_DownloadProgress(object sender, DownloadProgressEventArgs e) { }
/// <summary> /// 下载进度改变事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void bi_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (e.Progress < 100) { string result = string.Format("%{0}", e.Progress); if (ImgDownloadProgressChanged != null) { ImgDownloadProgressChanged(result); } } else { if (innerBitmap != null) { innerBitmap.DownloadProgress -= bi_DownloadProgress; } if (ImgDownloadCompleted != null) { ImgDownloadCompleted(); } SaveBitmapImage(innerBitmap); } }
// Image is loaded from Google void bitmapImage_Results(object sender, DownloadProgressEventArgs e) { // Disable LoadingListener for this image bitmapImage.DownloadProgress -= new EventHandler<DownloadProgressEventArgs>(bitmapImage_Results); // Show image details in UI if (isImageDeleted == 1)//Check if coming after deleting the image { ImageInfoTextBlock.Text = String.Format("Album {0} : Image {1} of {2}.", global.galbumlist[global.selectedAlbumIndex].title, (global.selectedImageIndex + 1), (global.galbumImages.Count -1)); isImageDeleted = 0; } else { ImageInfoTextBlock.Text = String.Format("Album {0} : Image {1} of {2}.", global.galbumlist[global.selectedAlbumIndex].title, (global.selectedImageIndex + 1), global.galbumImages.Count); } }
/// <summary> /// Raises the dowload progress event. /// </summary> /// <param name="e"></param> protected void RaiseDownloadProgress(DownloadProgressEventArgs e) { EventHandler<DownloadProgressEventArgs> downloadProgress = _downloadProgress; if (downloadProgress != null) { downloadProgress(this, e); } }
// Image is loaded from Google void bitmapImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { // Disable LoadingListener for this image bitmapImage.DownloadProgress -= new EventHandler<DownloadProgressEventArgs>(bitmapImage_DownloadProgress); // Show image details in UI img = app.selectedImageIndex; ImageInfoTextBlock.Text = String.Format(AppResources.currentimg, selectedAlbumTitle, (app.selectedImageIndex + 1), app.albumImages.Count); // Hide loading... animation ShowProgress = false; }
void newSource_DownloadProgress(object sender, DownloadProgressEventArgs e) { //loadingDialog.progressBar1.Value = e.Progress; }
/// Called when download progress is made private void OnDownloadProgress(object sender, DownloadProgressEventArgs e) { _progressEvent.InvokeEvents(this, e); }
void bmpImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (e.Progress == 100) { bmpImage.DownloadProgress -= new EventHandler<DownloadProgressEventArgs>(bmpImage_DownloadProgress); pnl.Children.Remove(rect); Shape.Fill = brush; } }
void bIm_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (e.Progress == 100) { } }
private void bmi_DownloadProgress(object sender, DownloadProgressEventArgs e, Tile tile, EventHandler<DownloadProgressEventArgs> onProgressEventHandler) { tile.Progress = e.Progress; if (!string.IsNullOrEmpty(tile.Url) && (tile.Image != null)) { if (e.Progress == 100) { (sender as BitmapImage).DownloadProgress -= onProgressEventHandler; if (!this.pendingTiles.ContainsKey(tile.Url)) { if (base.Container != null) { base.Container.Children.Remove(tile.Image); } return; } bool useTransitions = tile.UseTransitions; ShowImage(tile.Image, useTransitions); pendingTiles.Remove(tile.Url); } base.OnProgress(GetProgress()); } }
void bitmapImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { FinishedLoading(); }
//set download progress void decoder_DownloadProgress(object sender, DownloadProgressEventArgs e) { Progress = e.Progress/100.0; }
private void BitImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { ImageProgressBar.Value = e.Progress; }
public void OnSourceDownloadProgress(object sender, DownloadProgressEventArgs e) { BitmapFrameDecode clone = this.Target as BitmapFrameDecode; if (null != clone) { clone.OnDownloadProgress(sender, e); } else { DetachSourceDownloadHandlers(); } }
void bitmap_DownloadProgress(object sender, DownloadProgressEventArgs e) { //MessageBox.Show(e.Progress.ToString()); }
public void OnSourceDownloadProgress(object sender, DownloadProgressEventArgs e) { BitmapSource bitmapSource = this.Target as BitmapSource; if (null != bitmapSource) { bitmapSource.OnSourceDownloadProgress(bitmapSource, e); } else { DetachSourceDownloadHandlers(EventSource); } }
/// <summary> /// 下载图片进度 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void bitmapImage_DownloadProgress(object sender, DownloadProgressEventArgs e) { if (e.Progress == 100) { BitmapImage bitmapImage = sender as BitmapImage; int height = bitmapImage.PixelHeight; int width = bitmapImage.PixelWidth; //当下载的图片有效时 if (height > 0 && width > 0) { if (width > bitmapImage.PixelHeight) CurImage.Width = (width < CurImage.MaxWidth) ? width : CurImage.MaxWidth; else CurImage.Height = (height < CurImage.MaxHeight) ? height : CurImage.MaxHeight; CurImageFadeIn.Begin(); } else //不存在或路径无效时 { CurImage.Source = new BitmapImage(new Uri("/Images/NoPhoto.png", UriKind.RelativeOrAbsolute)); CurImage.Width = 380; CurImage.Height = 250; } LoadingBar.Visibility = System.Windows.Visibility.Collapsed; } else { //LoadInfo.Content = "正在加载数据" + e.Progress + "..."; LoadingBar.Value = e.Progress; LoadingBar.Visibility = System.Windows.Visibility.Visible; } }
private void OnSourceDownloadProgress(object sender, DownloadProgressEventArgs e) { RaiseDownloadProgress(e); }
void bmp_DownloadProgress(object sender, DownloadProgressEventArgs e) { version.Text += "."; }