-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HaRepacker] Fix blurry image rendered on the image preview window
- Loading branch information
1 parent
1493f67
commit 88d1141
Showing
4 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaRepacker.Converter | ||
{ | ||
/// <summary> | ||
/// Rounds a double to 2 decimal place, and an even number | ||
/// </summary> | ||
public class ImageZoomSliderConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
double zoom = (double)value; | ||
zoom = Math.Round(zoom, 2); // to 2 decimal place | ||
//System.Diagnostics.Debug.WriteLine(((zoom * 100))); | ||
if ((zoom * 100) % 2 != 0) // odd number | ||
zoom += 0.01; | ||
|
||
//System.Diagnostics.Debug.WriteLine("Zoom: " + zoom + " " + ((zoom * 100))); | ||
return zoom; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
return (double)value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters