请问如何使用二进制读取BMP文件的头文件的信息?
附BMP类型的定义:
Private Type BITMAP '14 bytes
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors(0 To &HFF) As RGBQUAD
End Type
附BMP类型的定义:
Private Type BITMAP '14 bytes
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors(0 To &HFF) As RGBQUAD
End Type
解决方案 »
- 如何编程获得页面中flv视频的真实地址
- VB汇总ACCESS导出至EXCEL打印...
- Tif 多页文件处理问题
- 请问大下门如何用vb得出一个目录下的所有某后缀格式的文件???多谢
- [求助]关于VB访问VF数据库及相关SQL语句的问题
- VB写控件的时候,如何获得Session中的参数值,最好有个例子参考一下
- 报表初学者!!!请各位帮帮忙..谢谢.在线等
- 我用VB编的ActiveX DLL,VB自己调用毫无问题,可在VC和Delphi中都调用不了......
- 精通SQL2000的高手请进,帮我看看错在哪!急。
- 大家讨论一下:C++中的类有结构有什么区别?
- 在窗体上放几个文本框,存放记录字段,大家是用绑定的办法呀?还是用代码把值写到文本框中呀?
- 高分求助:图像位处理的方法!
bfType(0 To 1) As Byte
bfSize As Long
bfReserved1 As Integer
bfReserved2 As Integer
bfOffBits As Long
End Type
Private Type BITMAPINFOHEADER
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
........
Dim bmfh As BITMAPFILEHEADER
Dim bmih As BITMAPINFOHEADER
open "你的bmp文件路径" for binary as #1
get #1,,bmfh
get #1,,bmih
close #1
不过,这种格式定义是C++中的吧?
不是VB “API 文本浏览器”中的定义吧?
有没有针对“API 文本浏览器”中的定义实现的代码呢?
不是VB “API 文本浏览器”中的定义吧?这个和vc或vb没什么关系,这是根据bmp的文件格式定义的