diff options
author | Alexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com> | 2017-11-25 15:09:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-25 15:09:29 +0300 |
commit | 24f06dc6f8ba09a5abf9e9520f34013a04f4f61b (patch) | |
tree | 9c874fa5f0a868bf9f0e65dbfdaab98517e7224a /Apps | |
parent | 62f8a6dba6c47a2789c5249bca425279c407bbcd (diff) | |
parent | 1439d063640793f2165513d6fda421f33378fdf3 (diff) |
Merge pull request #1058 from daPhie79/issue_1049
keep cover art image height an even number to avoid transparency issue on snesc
Diffstat (limited to 'Apps')
-rw-r--r-- | Apps/NesMiniApplication.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Apps/NesMiniApplication.cs b/Apps/NesMiniApplication.cs index 8b33f120..874d8ef4 100644 --- a/Apps/NesMiniApplication.cs +++ b/Apps/NesMiniApplication.cs @@ -420,14 +420,24 @@ namespace com.clusterrr.hakchi_gui maxY = 204;
}
if ((double)image.Width / (double)image.Height > (double)maxX / (double)maxY)
- outImage = new Bitmap(maxX, (int)((double)maxX * (double)image.Height / (double)image.Width));
+ {
+ int Y = (int)((double)maxX * (double)image.Height / (double)image.Width);
+ if (Y % 2 == 1)
+ ++Y;
+ outImage = new Bitmap(maxX, Y);
+ }
else
outImage = new Bitmap((int)(maxY * (double)image.Width / (double)image.Height), maxY);
int maxXsmall = 40;
int maxYsmall = 40;
if ((double)image.Width / (double)image.Height > (double)maxXsmall / (double)maxYsmall)
- outImageSmall = new Bitmap(maxXsmall, (int)((double)maxXsmall * (double)image.Height / (double)image.Width));
+ {
+ int Y = (int)((double)maxXsmall * (double)image.Height / (double)image.Width);
+ if (Y % 2 == 1)
+ ++Y;
+ outImageSmall = new Bitmap(maxXsmall, Y);
+ }
else
outImageSmall = new Bitmap((int)(maxYsmall * (double)image.Width / (double)image.Height), maxYsmall);
|