12136.html

来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>第一点</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>第一点</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:cww5@mail.ncku.edu.tw">cww</a> on April 18, 1999 at 20:52:11:<p>
In Reply to: <a href="11967.html">一些关于载入图档的问题</a> posted by south wind on April 14, 1999 at 12:19:04:<p>
您要的是该图是多少色(16, 256, ...)吧?<br>若是,可以用以下方式查得每个Pixel是多少个Bit来显示<br>于是也就知道该图是多少色的了。如果说要的是color <br>table that are actually used by the bitmap. 嗯,那<br>可能从  BITMAPINFOHEADER的biClrUsed 中去取得,不过<br>这得先了解Bitmap图的结构才取得出,这方面我也就不了解<br>了。<p>Private Type BITMAP<br>        bmType As Long<br>        bmWidth As Long<br>        bmHeight As Long<br>        bmWidthBytes As Long<br>        bmPlanes As Integer<br>        bmBitsPixel As Integer<br>        bmBits As Long<br>End Type<p>Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long<p>'查Picture1中的图是多少色<br>Dim i As Long<br>Dim bb As BITMAP<br>i = GetObject(Picture1.Picture.Handle, Len(bb), bb)<br>Debug.Print bb.bmBitsPixel, 2 ^ bb.bmBitsPixel<p><br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 12136-->
</ul><!--end: 12136-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?