示例#1
0
 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 { }
     }
 }
示例#2
0
 void MouseLeaveFile(object sender, FileMouseEventArgs e)
 {
     ThumbnailImage.Source     = null;
     ThumbnailImage.Visibility = Visibility.Collapsed;
 }
示例#3
0
 void MouseLeaveFile(object sender, FileMouseEventArgs e)
 {
     ThumbnailImage.Source = null;
     ThumbnailImage.Visibility = Visibility.Collapsed;
 }
示例#4
0
 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{ }
     }
 }