void MouseEnterFile(object sender, FileMouseEventArgs e) { //只对下面的图标文件类型生成缩略图 if ((".jpg.jpeg.png.bmp").IndexOf(Utils.CutString(e.FileInfo.FileName, e.FileInfo.FileName.LastIndexOf(".") + 1).ToLower()) >= 0) { BitmapImage bitimage = new BitmapImage(); try { bitimage.SetSource(e.FileInfo.ViewStream); ThumbnailImage.Source = bitimage; ThumbnailImage.Visibility = Visibility.Visible; Canvas.SetLeft(ThumbnailImageBorder, e.X + 50); Canvas.SetTop(ThumbnailImageBorder, e.Y - 30); object o = ThumbnailImage.GetValue(Canvas.ActualHeightProperty); ThumbnailImageBorder.Height = ThumbnailImage.Height + 10; expandImage.Begin(); } catch { } } }
void MouseLeaveFile(object sender, FileMouseEventArgs e) { ThumbnailImage.Source = null; ThumbnailImage.Visibility = Visibility.Collapsed; }
void MouseEnterFile(object sender, FileMouseEventArgs e) { //只对下面的图标文件类型生成缩略图 if ((".jpg.jpeg.png.bmp").IndexOf(Utils.CutString(e.FileInfo.FileName, e.FileInfo.FileName.LastIndexOf(".") + 1).ToLower()) >= 0) { BitmapImage bitimage = new BitmapImage(); try { bitimage.SetSource(e.FileInfo.ViewStream); ThumbnailImage.Source = bitimage; ThumbnailImage.Visibility = Visibility.Visible; Canvas.SetLeft(ThumbnailImageBorder, e.X + 50); Canvas.SetTop(ThumbnailImageBorder, e.Y - 30); object o = ThumbnailImage.GetValue(Canvas.ActualHeightProperty); ThumbnailImageBorder.Height = ThumbnailImage.Height + 10; expandImage.Begin(); } catch{ } } }