Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core 3.0 upgrade #6

Merged
merged 15 commits into from
Nov 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added maximum rotation to configuration
  • Loading branch information
jeremyknight-me committed Oct 5, 2019
commit 5fe5179c253a1cba6a78df85af1b8e25df18e2e9
2 changes: 2 additions & 0 deletions PhotoCollageScreensaver/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public Configuration()
this.Directory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
this.IsGrayscale = false;
this.IsRandom = true;
this.MaximumRotation = 15;
this.MaximumSize = 500;
this.NumberOfPhotos = 10;
this.Opacity = 1.0;
Expand All @@ -21,6 +22,7 @@ public Configuration()
public string Directory { get; set; }
public bool IsGrayscale { get; set; }
public bool IsRandom { get; set; }
public int MaximumRotation { get; set; }
public int MaximumSize { get; set; }
public int NumberOfPhotos { get; set; }
public double Opacity { get; set; }
Expand Down
17 changes: 9 additions & 8 deletions PhotoCollageScreensaver/PhotoCollageScreensaver.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<Authors>Jeremy Knight</Authors>
<Company>Jeremy KnightDigital Lagniappe</Company>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<Authors>Jeremy Knight</Authors>
<Company>Digital Lagniappe</Company>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace PhotoCollageScreensaver.UserControls
{
public partial class CollageImage : UserControl, IDisposable
{
private const int maximumAngle = 15;
private readonly string filePath;
private readonly CollagePresenter presenter;

Expand Down Expand Up @@ -95,6 +94,7 @@ private string GetDate()

private void RotateImageFrame()
{
int maximumAngle = this.presenter.Configuration.MaximumRotation;
int angle = this.presenter.GetRandomNumber(-maximumAngle, maximumAngle);
var transform = new RotateTransform(angle);
this.MainStackPanel.RenderTransform = transform;
Expand Down