Здравствуйте, AndrewVK,
Я пишу так :
[System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit)]
public class WKBPoint
{
[System.Runtime.InteropServices.FieldOffset(0)]
public byte[] bytesIn ;
[System.Runtime.InteropServices.FieldOffset(0)]
public byte byteOrder;
[System.Runtime.InteropServices.FieldOffset(1)]
public UInt32 wkbType;
[System.Runtime.InteropServices.FieldOffset(5)]
public Point point;
}
затем:
NpgsqlDataReader dr = command.ExecuteReader();
WKBPoint wpnt; ;
while (dr.Read())
{
wpnt = new WKBPoint();
wpnt.bytesIn = (byte[])dr[0];
e.Graphics.DrawIcon(ic, new Rectangle(wpnt.point, citySize));
}
Получаю ошибку :
Could not load type 'WKBPoint' from assembly 'ClientPlace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.
Я так понимаю дело в массиве byte[] bytesIn, как решить эту проблему ?