Private Sub Form_Load()
    Dim pic As StdPicture
    Set pic = LoadPicture("D:\sample.jpg")
    MsgBox (pic.Height)
    MsgBox (pic.Width)
End Sub
或者:
Private Type BITMAP
    bmType As Long
    bmWidth As Long
    bmHeight As Long
    bmWidthBytes As Long
    bmPlanes As Integer
    bmBitsPixel As Integer
    bmBits As Long
End Type
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
    
Private Sub Command1_Click()
    Dim PicInfo As BITMAP
    Dim pic As StdPicture
    Set pic = LoadPicture("D:\sample.jpg")
    
    GetObject pic.Handle, Len(PicInfo), PicInfo
    MsgBox PicInfo.bmHeight
    MsgBox PicInfo.bmWidth
    
End Sub

解决方案 »

  1.   

    设一个picturebox 
    with picturebox
    .autosize=true
    .loadpicture(yourpicture).heigth 和 .width 就是所求
    end with
      

  2.   

    我是说图像的实际尺寸(毫米),一幅图片用vb加载把scalmode 设成毫米,得到的尺寸,和在corel ,photoshop中显示的尺寸(毫米)不一样
      

  3.   

    用hydnoahark(诺亚方舟)的方法没错! 
      

  4.   

    检测图像的大小(如:64*64,12*12)。
    http://www.vbeden.com/download/code_4/kg.ziphttp://www.vbeden.com/vbcode/code_4.htm