Bitmap outputBitmap = new Bitmap(inputBitmap.Width * 5, inputBitmap.Height * 5);
using (Graphics graphics = Graphics.FromImage(outputBitmap))
{
graphics.CompositingQuality =
System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.InterpolationMode =
System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
graphics.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.DrawImage(inputBitmap, 0, 0,
inputBitmap.Width * 5, inputBitmap.Height * 5);
}
The result is an upscaled image offset by a few pixels in direction of top left corner.
How do I make this right?