Skip to content

Commit

Permalink
add TransitionDelay option for slideshow;
Browse files Browse the repository at this point in the history
add HEIC and HEIF as images;
add x86 platform;
fix typo;
bump version;
  • Loading branch information
changbowen committed Jan 13, 2023
1 parent e880eb8 commit 4bd54f1
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 12 deletions.
2 changes: 1 addition & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static string BuildConfig { get {
public static Version Version => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
public static readonly HashSet<string> ImageExtensions =
new HashSet<string>(new[] {
".jpg", ".jpeg", ".png", ".tiff", ".tif", ".gif", ".bmp", ".ico", ".dds", ".jxr", ".hdp", ".wdp"
".jpg", ".jpeg", ".png", ".tiff", ".tif", ".gif", ".bmp", ".ico", ".dds", ".jxr", ".hdp", ".wdp", ".heic", "heif"
});
public static readonly HashSet<string> ZipExtensions =
new HashSet<string>(new[] {
Expand Down
25 changes: 18 additions & 7 deletions Helpers/SlideshowHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
Expand Down Expand Up @@ -39,6 +40,17 @@ public SlideTransition Transition {
}
}

private TimeSpan transitionDelay = TimeSpan.Zero;
public TimeSpan TransitionDelay
{
get => transitionDelay;
set {
if (transitionDelay == value) return;
transitionDelay = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(TransitionDelay)));
}
}

private TimeSpan imageDuration = new TimeSpan(0, 0, 7);
public TimeSpan ImageDuration {
get => imageDuration;
Expand Down Expand Up @@ -206,6 +218,9 @@ public SlideAnimConfig(SlideAnimConfig config) {
private static readonly CubicEase easeIn = new CubicEase() { EasingMode = EasingMode.EaseIn };
private static readonly CubicEase easeInOut = new CubicEase() { EasingMode = EasingMode.EaseInOut };

/// <summary>
/// Returns the time until the next instance should be started.
/// </summary>
public static TimeSpan AnimateImage(DpiImage tgtImg, Size frameSize, SlideAnimConfig cfg) {
//fade
var animFade = new DoubleAnimationUsingKeyFrames();
Expand Down Expand Up @@ -240,19 +255,15 @@ public static TimeSpan AnimateImage(DpiImage tgtImg, Size frameSize, SlideAnimCo
break;
}

return cfg.Time_FadeOutBegin.TimeSpan;
return cfg.Time_FadeOutBegin.TimeSpan.Add(cfg.TransitionDelay);
}


/// <summary>
/// Returns the time until the next instance should be started.
/// </summary>
private static void Anim_KBE(DpiImage tgtImg, Size frameSize, SlideAnimConfig cfg) {
var zoomIn = ran.Next(2) == 0;
var panDirPri = ran.Next(2) == 0;//primary axis pan direction
var imageDur = new Duration(cfg.ImageDuration);

//zoon animation
//zoom animation
var animZoom = zoomIn ? new DoubleAnimation(1d, 1.2d, imageDur) : new DoubleAnimation(1.2d, 1d, imageDur);

//pan animation
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.5.0")]
[assembly: AssemblyFileVersion("1.2.5.0")]
[assembly: AssemblyVersion("1.2.6.0")]
[assembly: AssemblyFileVersion("1.2.6.0")]
1 change: 1 addition & 0 deletions Resources/Localization.en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<sys:String x:Key="ttl_Cancel">Cancel</sys:String>
<sys:String x:Key="ttl_RandomOrder">Random Order</sys:String>
<sys:String x:Key="ttl_Transition">Transition</sys:String>
<sys:String x:Key="ttl_TransitionDelay">Transition Delay</sys:String>
<sys:String x:Key="ttl_ResolutionScale">Resolution Scale</sys:String>
<sys:String x:Key="ttl_ImageDuration">Image Duration</sys:String>
<sys:String x:Key="ttl_FadeInDuration">Fade In Duration</sys:String>
Expand Down
1 change: 1 addition & 0 deletions Resources/Localization.zh.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<sys:String x:Key="ttl_Cancel">取消</sys:String>
<sys:String x:Key="ttl_RandomOrder">随机顺序</sys:String>
<sys:String x:Key="ttl_Transition">过渡效果</sys:String>
<sys:String x:Key="ttl_TransitionDelay">过渡效果延迟</sys:String>
<sys:String x:Key="ttl_ResolutionScale">分辨率比例</sys:String>
<sys:String x:Key="ttl_ImageDuration">图像时长</sys:String>
<sys:String x:Key="ttl_FadeInDuration">渐入时长</sys:String>
Expand Down
8 changes: 8 additions & 0 deletions SlideshowWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
</ContentControl>
</DockPanel>
</Border>
<Border>
<DockPanel>
<TextBlock Text="{StaticResource ttl_TransitionDelay}" Style="{StaticResource HeaderStyle}"/>
<ContentControl>
<TextBox Text="{Binding SlideAnimConfig.TransitionDelay, Source={x:Static local:App.Setting}}"/>
</ContentControl>
</DockPanel>
</Border>
<Border>
<DockPanel>
<TextBlock Text="{StaticResource ttl_ResolutionScale}" Style="{StaticResource HeaderStyle}"/>
Expand Down
8 changes: 8 additions & 0 deletions ZipImageViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
<PropertyGroup>
<ApplicationIcon>Resources\ZipImageViewer.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="FontAwesome5, Version=2.0.4.0, Culture=neutral, PublicKeyToken=9cfaf01297a008f8, processorArchitecture=MSIL">
<HintPath>packages\FontAwesome5.2.0.4\lib\net40\FontAwesome5.dll</HintPath>
Expand Down
10 changes: 8 additions & 2 deletions ZipImageViewer.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZipImageViewer", "ZipImageViewer.csproj", "{132432D4-022B-4A90-9DF8-EC3A4E94D79E}"
EndProject
Expand All @@ -14,18 +14,24 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|x64.ActiveCfg = Debug|x64
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|x64.Build.0 = Debug|x64
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|x86.ActiveCfg = Debug|x86
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Debug|x86.Build.0 = Debug|x86
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|Any CPU.Build.0 = Release|Any CPU
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|x64.ActiveCfg = Release|x64
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|x64.Build.0 = Release|x64
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|x86.ActiveCfg = Release|x86
{132432D4-022B-4A90-9DF8-EC3A4E94D79E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 4bd54f1

Please sign in to comment.