Win32
GetIconInfo
作为响应的一部分,调用将返回图标的源位图。您可以从中获取图标图像大小。
Dim IconInf As IconInfo
Dim BMInf As Bitmap
If (GetIconInfo(hIcon, IconInf)) Then
If (IconInf.hbmColor) Then ' Icon has colour plane
If (GetObject(IconInf.hbmColor, Len(BMInf), BMInf)) Then
Width = BMInf.bmWidth
Height = BMInf.bmHeight
BitDepth = BMInf.bmBitsPixel
End If
Call DeleteObject(IconInf.hbmColor)
Else ' Icon has no colour plane, image data stored in mask
If (GetObject(IconInf.hbmMask, Len(BMInf), BMInf)) Then
Width = BMInf.bmWidth
Height = BMInf.bmHeight \ 2
BitDepth = 1
End If
End If
Call DeleteObject(IconInf.hbmMask)
End If