Resizing Screenshots
I've been working on an application that takes a screenshot from a device and displays it in a Windows Forms application that can be resized. Prior to today, we used a PictureBox that was set to StretchImage (the screenshot is surrounded by a picture of the device).
However, new versions of the device return a screenshot that is twice as large. Making the new screenshot small then stretching it resulted in a hard to read display.
First off, I changed the code to paint the screenshot in the PictureBox separately, so it wouldn't get painted then stretched. Then, I started looking around at sharpening. I found this really helpful article, but the results weren't really what I was looking for.
Then I found another post that pointed me towards settings in the Graphics class that can change the output. I used a simple WinForms app with a couple forms displaying the same bitmap with different Graphics settings to subjectively compare the output. This seems to result in the highest quality for text in a resized screenshot (assume g is an instance of Graphics below):
g.SmoothingMode = SmoothingMode.None;
g.PixelOffsetMode = PixelOffsetMode.None;
g.CompositingQuality = CompositingQuality.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;