BitMapinfo结构

来源:互联网 发布:连云港 知乎 编辑:程序博客网 时间:2024/05/18 23:54
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct BITMAPINFO
{
    /// BITMAPINFOHEADER->tagBITMAPINFOHEADER
    public BITMAPINFOHEADER bmiHeader;
 
    /// RGBQUAD[1]
    [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 1, ArraySubType = UnmanagedType.Struct)]
    public RGBQUAD[] bmiColors;
}
 
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct BITMAPINFOHEADER
{
    /// DWORD->unsigned int
    public uint biSize;
 
    /// LONG->int
    public int biWidth;
 
    /// LONG->int
    public int biHeight;
 
    /// WORD->unsigned short
    public ushort biPlanes;
 
    /// WORD->unsigned short
    public ushort biBitCount;
 
    /// DWORD->unsigned int
    public uint biCompression;
 
    /// DWORD->unsigned int
    public uint biSizeImage;
 
    /// LONG->int
    public int biXPelsPerMeter;
 
    /// LONG->int
    public int biYPelsPerMeter;
 
    /// DWORD->unsigned int
    public uint biClrUsed;
 
    /// DWORD->unsigned int
    public uint biClrImportant;
}
 
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct RGBQUAD
{
    /// BYTE->unsigned char
    public byte rgbBlue;
 
    /// BYTE->unsigned char
    public byte rgbGreen;
 
    /// BYTE->unsigned char
    public byte rgbRed;
 
    /// BYTE->unsigned char
    public byte rgbReserved;
}
 
public partial class NativeMethods
{
 
    /// Return Type: BOOL->int
    ///pData: UCHAR**
    ///pInfo: BITMAPINFO**
    [DllImportAttribute("<Unknown>", EntryPoint = "MAG_GetOutputColorBardata")]
    [return: MarshalAsAttribute(UnmanagedType.Bool)]
    public static extern bool MAG_GetOutputColorBardata(ref IntPtr pData, ref IntPtr pInfo);
 
}
转自 http://bbs.csdn.net/topics/390324273?page=1
原创粉丝点击