Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Apps
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com>2017-10-09 15:26:29 +0300
committerGitHub <noreply@github.com>2017-10-09 15:26:29 +0300
commitf617a4a3be19c09c651f70d328b88b96bb839808 (patch)
tree96dd956a1d1c5dcad62e58768d82f1b266090174 /Apps
parent3137195e4f027ac6c45f8647fd355a03be403e49 (diff)
parentb03543956aa2a0bde12892762ac8636c517129db (diff)
Merge pull request #573 from r4dius/stable
Fix small image resizing quality
Diffstat (limited to 'Apps')
-rw-r--r--Apps/NesMiniApplication.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Apps/NesMiniApplication.cs b/Apps/NesMiniApplication.cs
index f2ad4c1b..7bc8478d 100644
--- a/Apps/NesMiniApplication.cs
+++ b/Apps/NesMiniApplication.cs
@@ -407,9 +407,16 @@ namespace com.clusterrr.hakchi_gui
gr.Flush();
outImage.Save(IconPath, ImageFormat.Png);
gr = Graphics.FromImage(outImageSmall);
+
+ // Better resizing quality (more blur like original files)
+ gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
- gr.DrawImage(outImage, new Rectangle(0, 0, outImageSmall.Width, outImageSmall.Height),
- new Rectangle(0, 0, outImage.Width, outImage.Height), GraphicsUnit.Pixel);
+ // Fix first line and column alpha shit
+ using (ImageAttributes wrapMode = new ImageAttributes())
+ {
+ wrapMode.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY);
+ gr.DrawImage(outImage, new Rectangle(0, 0, outImageSmall.Width, outImageSmall.Height), 0, 0, outImage.Width, outImage.Height, GraphicsUnit.Pixel, wrapMode);
+ }
gr.Flush();
outImageSmall.Save(SmallIconPath, ImageFormat.Png);
}