Hi,
Here, sample code where a byte array is used to fill a particular structure:
[...]
fs = File.OpenRead(p ath); // FileStream
BITMAPFILEHEADE R bfh = new BITMAPFILEHEADE R();
b = new byte[(int)bfh.Size()];
fs.Read(b, 0, b.Length);
fixed (byte* pb = &b[0])
bfh = (BITMAPFILEHEAD ER)Marshal.PtrT oStructure((Int Ptr)pb, typeof(BITMAPFI LEHEADER));
[...]
What I would like to have is a function capable of accepting an [in] byte array and an [out] unkown structure type.
Is that possible?
Thanks in advance,
Carles
Here, sample code where a byte array is used to fill a particular structure:
[...]
fs = File.OpenRead(p ath); // FileStream
BITMAPFILEHEADE R bfh = new BITMAPFILEHEADE R();
b = new byte[(int)bfh.Size()];
fs.Read(b, 0, b.Length);
fixed (byte* pb = &b[0])
bfh = (BITMAPFILEHEAD ER)Marshal.PtrT oStructure((Int Ptr)pb, typeof(BITMAPFI LEHEADER));
[...]
What I would like to have is a function capable of accepting an [in] byte array and an [out] unkown structure type.
Is that possible?
Thanks in advance,
Carles
Comment