mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 09:49:07 +00:00
Use my home-made GIF and APNG animator. It's really save CPU compared to previous one!
This commit is contained in:
@@ -34,9 +34,10 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
/// <summary>
|
||||
/// Interaction logic for ImagePanel.xaml
|
||||
/// </summary>
|
||||
public partial class ImagePanel : UserControl, INotifyPropertyChanged
|
||||
public partial class ImagePanel : UserControl, INotifyPropertyChanged, IDisposable
|
||||
{
|
||||
private Point? _dragInitPos;
|
||||
private Uri _imageSource;
|
||||
private DateTime _lastZoomTime = DateTime.MinValue;
|
||||
private double _maxZoomFactor = 3d;
|
||||
private double _minZoomFactor = 0.1d;
|
||||
@@ -111,6 +112,16 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
}
|
||||
}
|
||||
|
||||
public Uri ImageUriSource
|
||||
{
|
||||
get => _imageSource;
|
||||
set
|
||||
{
|
||||
_imageSource = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public BitmapSource Source
|
||||
{
|
||||
get => _source;
|
||||
@@ -118,9 +129,18 @@ namespace QuickLook.Plugin.ImageViewer
|
||||
{
|
||||
_source = value;
|
||||
OnPropertyChanged();
|
||||
|
||||
if (ImageUriSource == null)
|
||||
viewPanelImage.Source = _source;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
viewPanelImage?.Dispose();
|
||||
viewPanelImage = null;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public event EventHandler<int> ImageScrolled;
|
||||
|
Reference in New Issue
Block a user