As @EmirAkaydin said in his answer, your problem lies in interpolation. I suspect that his answer about this, only one pixel, contrary to Microsoft's resizing algorithm, is correct.
I have a two-story solution for you. If you don’t want to write your own resizing code (I don’t want), which will change the way you want, you can still use the Graphics.DrawImage function to at least resize the width of your image, but only the width. Then you can directly manipulate the pixel data and copy every first valid row for the entire height of the image.
You can replace the DoDemo code DoDemo following (I don't use VB, so I'm not sure about the coding style, but it works):
Call CreateSampleImage() 'scale the image to only one single row Dim bm As New Bitmap(450, 1) Using gr As Graphics = Graphics.FromImage(bm) Dim RDst As New Rectangle(0, 0, bm.Width, bm.Height) Dim RSrc As New Rectangle(0, 0, Me.PictureBox1.Image.Width, Me.PictureBox1.Image.Height) gr.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor gr.SmoothingMode = Drawing2D.SmoothingMode.None gr.DrawImage(Me.PictureBox1.Image, RDst, RSrc, GraphicsUnit.Pixel) End Using Me.PictureBox2.Image = bm 'stretch now the single row image back to original width Dim bm2 As New Bitmap(Me.PictureBox1.Image.Width, Me.PictureBox1.Image.Height) Using gr As Graphics = Graphics.FromImage(bm2) Dim RDst As New Rectangle(0, 0, bm2.Width, 1) Dim RSrc As New Rectangle(0, 0, Me.PictureBox2.Image.Width, Me.PictureBox2.Image.Height) gr.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor gr.SmoothingMode = Drawing2D.SmoothingMode.None gr.DrawImage(Me.PictureBox2.Image, RDst, RSrc, GraphicsUnit.Pixel) End Using ' use our own custom height stretch code Dim rrc As New Rectangle(0, 0, bm2.Width, bm2.Height) Dim bmd As BitmapData bmd = bm2.LockBits(rrc, ImageLockMode.ReadWrite, bm2.PixelFormat) ' stride is the width of the image in pixels Dim ba(bmd.Stride - 1) As Byte Marshal.Copy(bmd.Scan0, ba, 0, bmd.Stride) ' copy pixel data to each line For y = 1 To bmd.Height - 1 Marshal.Copy(ba, 0, bmd.Scan0 + (y * bmd.Stride), ba.Length) Next bm2.UnlockBits(bmd) Me.PictureBox3.Image = bm2
EDIT:
Interestingly, @FredrikJohansson's code also published a paper:
gr.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
before you draw an image. I'm going to leave this code and answer here if someone wants to see it, but it looks like it answered your question in a simpler way :)