11125.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 23 行
HTML
23 行
<html>
<head>
<title>Re: 如何得到bmp的资讯??</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 如何得到bmp的资讯??</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:honey0@tcts1.seed.net.tw">Honey</a> on March 18, 1999 at 22:51:15:<p>
In Reply to: <a href="11083.html">如何得到bmp的资讯??</a> posted by 索尔 on March 18, 1999 at 03:48:32:<p>
使用BITMAPINFOHEADER及BITMAPFILEHEADER<br>两个'类型'<br>宣告方式如下<p>Private Type BITMAPINFOHEADER<br> biSize As Long<br> biWidth As Long<br> biHeight As Long<br> biPlanes As Integer<br> biBitCount As Integer<br> biCompression As Long<br> biSizeImage As Long<br> biXPelsPerMeter As Long<br> biYPelsPerMeter As Long<br> biClrUsed As Long<br> biClrImportant As Long<br>End Type<br>Private Type BITMAPFILEHEADER<br> bfType As Integer<br> bfSize As Long<br> bfReserved1 As Integer<br> bfReserved2 As Integer<br> bfOffBits As Long<br>End Type<p>之后可用以下方法取得结构<br>Dim BFH As BITMAPFILEHEADER<br>Dim BIH As BITMAPINFOHEADER<br>Open StrFileName For Binary Access Read As #1<br>Get #1, , BFH<br>Get #1, , BIH<br>Close<p>关于BITMAPFILEHEADER结构的值代表如下<br>bfType<br> Specifies the file type. <br> It must be BM. <br>bfSize<br> Specifies the size, <br> in bytes, of the bitmap file. <p>bfReserved1<br> Reserved; must be zero. <p>bfReserved2<br> Reserved; must be zero. <p>bfOffBits<br> Specifies the offset, in bytes, <br> from the BITMAPFILEHEADER structure <br> to the bitmap bits.<p>关于BITMAPINFOHEADER结构的值代表如下<br>biSize<br> Specifies the number of bytes required by <br> the structure. <p>biWidth<br> Specifies the width of the bitmap, in pixels. <p>biHeight<br> Specifies the height of the bitmap, in pixels.<br> If biHeight is positive, the bitmap is a bottom-up <br> DIB and its origin is the lower left corner. If <br> biHeight is negative, the bitmap is a top-down DIB <br> and its origin is the upper left corner. <p>biPlanes<br> Specifies the number of planes for the target device.<br> This value must be set to 1. <p>biBitCount<br> Specifies the number of bits per pixel. <br> This value must be 1, 4, 8, 16, 24, or 32. <p>biCompression<br> Specifies the type of compression for a compressed<br> bottom-up bitmap (top-down DIBs cannot be compressed).<br> It can be one of the following values: <br> <br> Value Description<br> BI_RGB An uncompressed format.<p> BI_RLE8 A run-length encoded (RLE) <br> format for bitmaps with 8 bits <br> per pixel. The compression format <br> is a two-byte format consisting of <br> a count byte followed by a byte <br> containing a color index. For more <br> information, see the following <br> Remarks section.<p> BI_RLE4 An RLE format for bitmaps with 4 <br> bits per pixel. The compression <br> format is a two-byte format <br> consisting of a count byte followed <br> by two word-length color indices. <br> For more information, see the <br> following Remarks section.<p> BI_BITFIELDS Specifies that the bitmap is not <br> compressed and that the color table <br> consists of three doubleword color <br> masks that specify the red, green,<br> and blue components, respectively, <br> of each pixel. This is valid when <br> used with 16- and 32-bits-per-pixel <br> bitmaps.<br> <p>biSizeImage<br> Specifies the size, in bytes, of the image. <br> This may be set to 0 for BI_RGB bitmaps. <p>biXPelsPerMeter<br> Specifies the horizontal resolution, <br> in pixels per meter, of the target device <br> for the bitmap. An application can use this <br> value to select a bitmap from a resource group <br> that best matches the characteristics of the <br> current device. <p>biYPelsPerMeter<br> Specifies the vertical resolution, in pixels <br> per meter, of the target device for the bitmap. <p>biClrUsed<br> Specifies the number of color indices in the <br> color table that are actually used by the <br> bitmap. If this value is zero, the bitmap uses <br> the maximum number of colors corresponding to <br> the value of the biBitCount member for the <br> compression mode specified by biCompression. <p> If biClrUsed is nonzero and the biBitCount member <br> is less than 16, the biClrUsed member specifies <br> the actual number of colors the graphics engine <br> or device driver accesses. If biBitCount is 16 or <br> greater, then biClrUsed member specifies the size <br> of the color table used to optimize performance of<br> Windows color palettes. If biBitCount equals 16 or <br> 32, the optimal color palette starts immediately <br> following the three doubleword masks. <p> If the bitmap is a packed bitmap (a bitmap in <br> which the bitmap array immediately follows the <br> BITMAPINFO header and which is referenced by a <br> single pointer), the biClrUsed member must be <br> either 0 or the actual size of the color table.<p>biClrImportant<br> Specifies the number of color indices that <br> are considered important for displaying the bitmap. <br> If this value is zero, all colors are important.<p>够复杂吧 加油喔 后天要面试了 没时间帮你翻成中文<br>不过应该看的懂吧<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 11125-->
</ul><!--end: 11125-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?