VB Code:
Private Sub CreateThumbGenie()
Dim NewImage As Image = Image.FromFile("filename")
' Make a bitmap for the result.
Dim DestSize As New Bitmap( _
CInt(PictureBox1.Width), _
CInt(PictureBox1.Height))
' Make a Graphics object for the result Bitmap.
Dim GenDest As Graphics = Graphics.FromImage(DestSize)
' Copy the source image into the destination bitmap.
GenDest.DrawImage(NewImage, 0, 0, _
DestSize.Width + 1, _
DestSize.Height + 1)
' Display the result.
PictureBox1.Image = DestSize
End Sub
'later in a command button, you can call it as:
[b] CreateThumbGenie()[/b]