Private Sub PathList_Click()
'MsgBox PathList.List(PathList.ListIndex)
'Picture1.Width = 200
'Picture1.Height = 300
Picture1.Picture = LoadPicture("c:\xxx.jpg") '浏览图片
'Picture1.PaintPicture Picture1.Picture, 0, 0, 3500, 2000
w = Picture1.Picture.Width '图片原宽
h = Picture1.Picture.Height '图片原高
If h > w Or h = w Then '如果图是高大于宽的
Image1.Height = 3400 '3400是要缩小或放大到的尺寸,可自行设定
Image1.Width = 3400 * w / h
Image1.Picture = Picture1.Picture
Else '如果宽大于高
Image1.Width = 3400
Image1.Height = 3400 * h / w
Image1.Picture = Picture1.Picture
End If
End Sub