- Код: Выделить всё
Option Explicit
Private Type ICONDIR
idReserved As Integer
idType As Integer
idCount As Integer
End Type
Private Type ICONDIRENTRY
bWidth As Byte
bHeight As Byte
bColorCount As Byte
bReserved As Byte
wPlanes As Integer
wBitCount As Integer
dwBytesInRes As Long
dwImageOffset 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
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Private Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As Any, ByVal wUsage As Long) As Long
Dim IconCount() As ICONDIRENTRY
Dim i
Private Function hIconFromFile(ByVal strFileName As String) As Long
Dim bICOData() As Byte
Dim n As Long
Dim BIH As BITMAPINFOHEADER
Dim IDE As ICONDIRENTRY
Dim ID As ICONDIR
Dim BI As BITMAPINFO
n = FreeFile
Open strFileName For Binary Access Read As #n
Get #n, 1, ID
ReDim IconCount(ID.idCount)
Get #n, 7, IconCount
'Get #n, 38
'то самое место
Close #n
For i = LBound(IconCount) To UBound(IconCount) - 1
MsgBox ID.idCount & " " & IconCount(i).bWidth & " " & IconCount(i).bHeight & " " & IconCount(i).wBitCount & " " & IconCount(i).dwImageOffset
Next
'SetDIBitsToDevice
End Function
Private Sub Form_Click()
hIconFromFile "d:\1.ico"
Refresh
End Sub
ребяты помогите