Searching in this forum, I found a good piece of code to resize the image in a picturebox to fit the picturebox.
That is the code in post #5 under this thread: http://www.vbforums.com/showthread.p...e-image-to-fit
It works fine with bitmap, jpeg and gif files.

Then I searched this forum again and found a piece of code that lets us load a PNG file into a picturebox.
It was provided by LaVolpe (Many thanks to him).
Here it is:
Code:
Private Function RenderPNG(Filename As String, hDC As Long, X As Long, Y As Long) As Boolean
    On Error Resume Next
    GDIsi.GdiplusVersion = 1&
'    GdiplusStartup gToken, GDIsi
'    If Err Then
'          Err.Clear
'          Exit Function
'    ElseIf gToken = 0& Then
'         Exit Function
'    End If
    On Error GoTo 0
    Call GdipCreateFromHDC(hDC, hGraphics)
    If hGraphics Then
        Call GdipLoadImageFromFile(StrPtr(Filename), hBitmap)
        If hBitmap Then
            GdipDrawImage hGraphics, hBitmap, X, Y
            GdipDisposeImage hBitmap
            RenderPNG = True
        End If
        GdipDeleteGraphics hGraphics
    End If
'    GdiplusShutdown gToken
    
End Function
This code also works fine, and shows a PNG file in a picturebox.
However, when I use that resize piece of code to resize the PNG image to fit the picturebox, it gives me a runtime error:
Run-time error 481: Invalid picture.

This is the exact line of code that gives me that run-time error:
Code:
Picture1.PaintPicture Picture1.Picture, _
    0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, _
    0, 0, Picture1.Picture.Width / 26.46, _
    Picture1.Picture.Height / 26.46
How can I fix this?

I am really looking for a minimallistic way of doing it.
I don't think I'd be comfortable with subclassing or very complicated approaches. I have never done subclassing before.
Hopefully there is an easy way of resizing a PNG image.

Please advise.
Thanks.