Unasafe and fixed in vb.net
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public unsafe struct SGDeviceInfoParam
{
private const int SGDEV_SN_LEN = 15; // Device Serial Number Length
public UInt32 DeviceID;
**Here is problem ** // 0 - 9
public fixed Byte DeviceSN[SGDEV_SN_LEN + 1]; // Device Serial Number, Length of SN = 15
public UInt32 ComPort; // Parallel device=>PP address, USB device=>USB(0x3BC+1)
public UInt32 ComSpeed; // Parallel device=>PP mode, USB device=>0
public UInt32 ImageWidth; // Image Width
public UInt32 ImageHeight; // Image Height
public UInt32 Contrast; // 0 ~ 100
public UInt32 Brightness; // 0 ~ 100
public UInt32 Gain; // Dependent on each device
public UInt32 ImageDPI; // DPI
public UInt32 FWVersion; // FWVersion
}
It is my effort but I`m not satisfied
<StructLayout(LayoutKind.Sequential, Pack:=1)>
Public Structure SGDeviceInfoParam
Private Const SGDEV_SN_LEN As Integer = 15
' Device Serial Number Length
Public DeviceID As UInt32
' Device Serial Number, Length of SN = 15
Public ComPort As UInt32
' Parallel device=>PP address, USB device=>USB(0x3BC+1)
Public ComSpeed As UInt32
' Parallel device=>PP mode, USB device=>0
Public ImageWidth As UInt32
' Image Width
Public ImageHeight As UInt32
' Image Height
Public Contrast As UInt32
' 0 ~ 100
Public Brightness As UInt32
' 0 ~ 100
Public Gain As UInt32
' Dependent on each device
Public ImageDPI As UInt32
' DPI
Public FWVersion As UInt32
End Structure
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.