The following two code samples are equivalent in that they produce a scaled image. That said, does the second produce a scaled image of higher quality? I am using .NET 4.5.
// The short.
using(Bitmap large = new Bitmap(input, width, height))
{
// Do whatever.
}
// The long.
using(Bitmap large = new Bitmap(width, height))
{
using(Graphics g = Graphics.FromImage(large))
{
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.DrawImage(input, 0, 0, width, height);
}
// Do whatever.
}
The difference between the two is that the previous one uses the defaults;
So, yes, the latter should definitely give a boost in image quality.
Simplified, the relevant code in the Bitmap constructor is (exception handling stripped) something like;
…which is pretty much what you have, except you’re tuning the quality up.