/// <summary> /// 开始载入视频 /// </summary> public bool OpenCapture(Panel pnlVideo) { bool videostart = false; int intWidth = pnlVideo.Width; int intHeight = pnlVideo.Height; int intDevice = 0; string refDevice = intDevice.ToString(); //创建视频窗口并得到句柄 hHwnd = VedioGrap.capCreateCaptureWindowA(ref refDevice, 1342177280, 0, 0, 640, 480, pnlVideo.Handle.ToInt32(), 0); if (SendMessage(hHwnd, 0x40a, intDevice, 0) > 0) { SendMessage(hHwnd, 0x435, -1, 0); SendMessage(hHwnd, 0x434, 0x01, 0); SendMessage(hHwnd, 0x432, -1, 0); SetWindowPos(hHwnd, 1, 0, 0, intWidth, intHeight, 6); videostart = true; } else { VedioGrap.DestroyWindow(hHwnd); videostart = false; MessageBox.Show("加载视频失败,请检查是否有安装设备!", "拍照"); } return(videostart); }
private void ImageProcessPanel_Load(object sender, EventArgs e) { //twain = new TwainHelper(this.panelContent); vedioGrap = new VedioGrap(); }
private void UserControl1_Load(object sender, EventArgs e) { vedioGrap = new VedioGrap(); this.BeginPhoto(); }