Private Sub Command1_Click() If imgSample1.Picture.Handle = 0 Then MsgBox "未加载图片。" Else MsgBox "已加载图片 " & Int(ScaleX(imgSample1.Picture.Width, vbHimetric, vbPixels)) & _ "x" & Int(ScaleY(imgSample1.Picture.Height, vbHimetric, vbPixels)) End If End Sub
If imgSample1.Picture.Handle = 0 Then
MsgBox "未加载图片。"
Else
MsgBox "已加载图片 " & Int(ScaleX(imgSample1.Picture.Width, vbHimetric, vbPixels)) & _
"x" & Int(ScaleY(imgSample1.Picture.Height, vbHimetric, vbPixels))
End If
End Sub