1
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. what it should look like and what it looks like

How do I make this right?

4

0 回答 0