用法:
取得圖片的大少,色彩等資料。
宣告法:
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
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 Sub Command1_Click()
Dim Pic As Picture
Dim BM As BITMAP
Pic = LoadPicture("C:\ABC.bmp")
GetObject BM, Len(Pic), Pic
MsgBox "圖片寬度" & BM.bmWidth
MsgBox "圖片高度" & BM.bmHeight
End Sub