A
active
The structue below contains:
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)>
which might work for some examples but in general the size needs to be set
at run time (to
InBitmap.Palette.Entries.Length) before the structure is passed to a windows
API function.
How to handle the structure array?
How to fill in the structure?
I've found some API functions that might do it after more study. Is that the
way to go or do I simply fill in the data?
Thanks in advance for any help
Public Structure BitmapInfo
Public bmiHeader As BitmapInfoHeader
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public bmiColors() As
RGBQuad
End Structure
Public Structure BitmapInfoHeader
Public biSize As Integer
Public biWidth As Integer
Public biHeight As Integer
Public biPlanes As Short
Public biBitCount As Short
Public biCompression As Integer
Public biSizeImage As Integer
Public biXPelsPerMeter As Integer
Public biYPelsPerMeter As Integer
Public biClrUsed As Integer
Public biClrImportant As Integer
End Structure
Public Structure RGBQuad
Public rgbBlue As Byte
Public rgbGreen As Byte
Public rgbRed As Byte
Public rgbReserved As Byte
End Structure
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)>
which might work for some examples but in general the size needs to be set
at run time (to
InBitmap.Palette.Entries.Length) before the structure is passed to a windows
API function.
How to handle the structure array?
How to fill in the structure?
I've found some API functions that might do it after more study. Is that the
way to go or do I simply fill in the data?
Thanks in advance for any help
Public Structure BitmapInfo
Public bmiHeader As BitmapInfoHeader
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public bmiColors() As
RGBQuad
End Structure
Public Structure BitmapInfoHeader
Public biSize As Integer
Public biWidth As Integer
Public biHeight As Integer
Public biPlanes As Short
Public biBitCount As Short
Public biCompression As Integer
Public biSizeImage As Integer
Public biXPelsPerMeter As Integer
Public biYPelsPerMeter As Integer
Public biClrUsed As Integer
Public biClrImportant As Integer
End Structure
Public Structure RGBQuad
Public rgbBlue As Byte
Public rgbGreen As Byte
Public rgbRed As Byte
Public rgbReserved As Byte
End Structure