private void btnSnap_Click(object sender, EventArgs e) { NET_DVR_MANUALSNAP snap = new NET_DVR_MANUALSNAP(); snap.byPumpID = (byte)comboNozzle.SelectedIndex; snap.byPumpStatus = (byte)comboNozzleStatus.SelectedIndex; NET_DVR_PLATE_RESULT plateResult = new NET_DVR_PLATE_RESULT(); IntPtr ret = Marshal.AllocHGlobal(Marshal.SizeOf(plateResult)); if (HCNetSDK.NET_DVR_ManualSnap(0, ref snap, ret)) { plateResult = (NET_DVR_PLATE_RESULT)Marshal.PtrToStructure(ret, typeof(NET_DVR_PLATE_RESULT)); lblPlate.Text = System.Text.Encoding.Default.GetString(plateResult.sLicense); lblPlateColor.Text = dicPlateColor[plateResult.byPlateColor]; lblCarBrand.Text = dicCarBrand[plateResult.wVehicleLogoRecog]; lblCarColor.Text = dicCarColor[plateResult.byColor]; lblCarSubBrand.Text = "未知"; lblCarType.Text = "未知"; } else { MessageBox.Show("抓拍失败"); } }
public static extern bool NET_DVR_ManualSnap(uint lUserID, ref NET_DVR_MANUALSNAP lpInter, IntPtr lpOuter);