private void BtnStop_Click(object sender, EventArgs e) { IQCPurchaseMulPcode.SendMessage(this.hHwnd, 0x40b, 0, 0); IQCPurchaseMulPcode.DestroyWindow(this.hHwnd); this.BtnCapTure.Enabled = true; this.BtnStop.Enabled = false; }
private void btnphoto_Click(object sender, EventArgs e) { try { IQCPurchaseMulPcode.SendMessage(this.hHwnd, 0x41e, 0, 0); IDataObject obj1 = Clipboard.GetDataObject(); if (obj1.GetDataPresent(typeof(Bitmap))) { Image image1 = (Image)obj1.GetData(typeof(Bitmap)); SaveFileDialog SaveFileDialog1 = new SaveFileDialog(); SaveFileDialog1.FileName = txtpurchasep.Text; SaveFileDialog1.Filter = "Image Files(*.JPG;*.GIF)|*.JPG;*.GIF|All files (*.*)|*.*"; if (SaveFileDialog1.ShowDialog() == DialogResult.OK) { image1.Save(SaveFileDialog1.FileName, ImageFormat.Jpeg); } } } catch { } }
private void OpenCapture() { int intWidth = this.panel_Vedio.Width; int intHeight = this.panel_Vedio.Height; int intDevice = 0; string refDevice = intDevice.ToString(); hHwnd = IQCPurchaseMulPcode.capCreateCaptureWindowA(ref refDevice, 1342177280, 0, 0, 640, 480, this.panel_Vedio.Handle.ToInt32(), 0); if (IQCPurchaseMulPcode.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0) { IQCPurchaseMulPcode.SendMessage(this.hHwnd, 0x435, -1, 0); IQCPurchaseMulPcode.SendMessage(this.hHwnd, 0x434, 0x42, 0); IQCPurchaseMulPcode.SendMessage(this.hHwnd, 0x432, -1, 0); IQCPurchaseMulPcode.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 6); this.BtnCapTure.Enabled = false; this.BtnStop.Enabled = true; } else { IQCPurchaseMulPcode.DestroyWindow(this.hHwnd); this.BtnCapTure.Enabled = false; this.BtnStop.Enabled = true; } }