c编的DLL中有一个struct类形要作为参数,c#应该怎么声明?
ypedef struct {
int nChannels;
int width;
int height;
char* imageData;
} SimpleImage;
typedef struct {
bool success
int cpBmpIndex
hbcpSimpleImage* cpBmp;//关键是这两处又有一个指向另一种结构的指针。
hbcpSimpleImage* cpBmpBinary;//关键是这两处又有一个指向另一种结构的指针。
RECT cpRect;
int nCpTexts;
SimpleImage* pCpTexts;
} RecogniseResult;
我的SimpleImage试过这样定义不知行不行。
[StructLayout(LayoutKind.Sequential)]
struct SimpleImage
{
public int nChannels;
public int width;
public int height;
[MarshalAs(UnmanagedType.ByValArray)]
public char[] imageData;//这里不知能不能这样。
}