# 第一点

Posted by cww on April 18, 1999 at 20:52:11:

In Reply to: 一些关于载入图档的问题 posted by south wind on April 14, 1999 at 12:19:04:

您要的是该图是多少色(16, 256, ...)吧？
若是，可以用以下方式查得每个Pixel是多少个Bit来显示
于是也就知道该图是多少色的了。如果说要的是color
table that are actually used by the bitmap. 嗯，那
可能从 BITMAPINFOHEADER的biClrUsed 中去取得，不过
这得先了解Bitmap图的结构才取得出，这方面我也就不了解
了。

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

'查Picture1中的图是多少色
Dim i As Long
Dim bb As BITMAP
i = GetObject(Picture1.Picture.Handle, Len(bb), bb)
Debug.Print bb.bmBitsPixel, 2 ^ bb.bmBitsPixel

Follow Ups: