C# Type conversion when using CreateDIBSection -


first, please read link

to using createdibsection in c#, defined this.

[dllimport("gdi32.dll", entrypoint = "createdibsection")] public static extern intptr createdibsection(intptr hdc, ref bitmapinfo pbmi,                      uint iusage, out intptr ppvbits, intptr hsection, uint dwoffset); 

and defined structure type learned link this

public unsafe struct my_binfo {     [marshalas(unmanagedtype.u4)]     public fixed uint bmicolors[3];  } 

a problem related mybitmapinfo defined.

[structlayout(layoutkind.sequential)] public unsafe struct mybitmapinfo  {    public bitmapinfoheader bmiheader;     [marshalas(unmanagedtype.u4)]    public fixed uint bmicolors[3];  } 

when call createdibsection function, mybitmapinfo converted bitmapinfo type [link_1]

createdibsection(hdc, (const bitmapinfo* )&dibinfo, ... ) //c++ code 

however dont't know how write c# code same thing above code.(type conversion mybitmapinfo bitmapinfo)

thank reading.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -