As I said image will be distorted ... Try this another quick sample and let me know if it works for you:
VB Code:
Private Sub Command1_Click()
'============================
Dim pctTemp As PictureBox
Dim blnHigher As Boolean
Dim dRatio As Double
Set pctTemp = Controls.Add("VB.Picturebox", "picTemp")
pctTemp.AutoSize = True
pctTemp.Visible = False
pctTemp.Picture = LoadPicture("C:\My Documents\Images\JPG\someimage.jpg")
blnHigher = IIf(pctTemp.Height > pctTemp.Width, True, False)
dRatio = pctTemp.Height / pctTemp.Width
With Picture1
.AutoRedraw = True
If blnHigher Then
.Height = 3000
.Width = 3000 / dRatio
Else
.Width = 3000
.Height = 3000 * dRatio
End If
.PaintPicture pctTemp.Picture, 0, 0, .ScaleWidth, .ScaleHeight
Set .Picture = .Image
End With
Controls.Remove "picTemp"
Set pctTemp = Nothing
End Sub