| 
    
     |  | ▼かみちゃん さん: >ただし、ピクセルではなくドット単位に取得しています。
 そのドットがピクセルです。
 
 あと、構造体を使わない方法で行くなら、ループで読み飛ばす必要ないです。
 
 Private Sub CommandButton1_Click()
 Dim strPath As String
 Dim strType As String * 2
 Dim biWidth As Long
 Dim biHeight As Long
 
 strPath = ThisWorkbook.Path & "\test.bmp"
 
 Open strPath For Binary As #1
 Get #1, , strType
 Get #1, 19, biWidth’ファイルポインタを進める
 Get #1, , biHeight
 Close #1
 
 If strType = "BM" Then
 MsgBox "幅=" & biWidth & " : 高さ=" & biHeight
 End If
 
 End Sub
 
 厳密には、この方法でも駄目なことがあるかも。
 以下、ヘルプより。
 BITMAPINFO構造体またはBITMAPCOREINFO構造体は、 DIBファイル内のBITMAPFILEHEADER構造体の直後に置かれます。
 BITMAPINFOと、BITMAPCOREINFOのサイズ用メンバは、異なる型…。
 
 
 |  |