public static void ShowCalibration(Point point) { if (form == null) { form = new CalibrationForm(); form.TopMost = true; } form.ShowCalibration(point, CROSSHAIR_SIZE, p); form.Show(); }
void controller_CalibrationStateChanged(object sender, EventArgs <Controller.CalibrationStateInfo> e) { if (e.Value.State > 0) { BeginInvoke((MethodInvoker) delegate() { TopMost = false; CalibrationForm.ShowCalibration(e.Value.TargetPoint); }); } else { BeginInvoke((MethodInvoker) delegate() { CalibrationForm.HideCalibration(); UpdateTrackingUtilization(controller.SourceLayout); TopMost = cbAlwaysOnTop.Checked; }); } }
private void btnCalibrate_Click(object sender, EventArgs e) { if (cf == null || cf.IsDisposed) { cf = new CalibrationForm(); } cf.Show(); _cursorControl = false; _calibrationState = 1; DoCalibration(); }
void controller_CalibrationStateChanged(object sender, EventArgs <Controller.CalibrationStateInfo> e) { try { if (e.Value.State > 0) { BeginInvoke((MethodInvoker) delegate() { TopMost = false; CalibrationForm.ShowCalibration(e.Value.TargetPoint); }); } else { BeginInvoke((MethodInvoker) delegate() { CalibrationForm.HideCalibration(); UpdateTrackingUtilization(controller.SourceLayout); TopMost = cbAlwaysOnTop.Checked; }); } } catch (Exception) { MessageBox.Show("Error! Problema Con La Wiilib", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
public void doCalibration() { if (cf == null) { return; } int x = 0; int y = 0; int size = 25; Pen p = new Pen(Color.Red); switch (calibrationState) { case 1: x = (int)(screenWidth * calibrationMargin); y = (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 2: x = screenWidth - (int)(screenWidth * calibrationMargin); y = (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 3: x = (int)(screenWidth * calibrationMargin); y = screenHeight - (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 4: x = screenWidth - (int)(screenWidth * calibrationMargin); y = screenHeight - (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 5: //compute warp warper.setDestination(dstX[0], dstY[0], dstX[1], dstY[1], dstX[2], dstY[2], dstX[3], dstY[3]); warper.setSource(srcX[0], srcY[0], srcX[1], srcY[1], srcX[2], srcY[2], srcX[3], srcY[3]); warper.computeWarp(); f.Close(); cf = null; calibrationState = 0; cursorControl = true; BeginInvoke((MethodInvoker) delegate() { cbCursorControl.Checked = cursorControl; }); // saveCalibrationData(); UpdateTrackingUtilization(); break; default: break; } }
private void btnCalibrate_Click(object sender, EventArgs e) { if (cf == null) { cf = new CalibrationForm(); cf.Show(); } if (cf.IsDisposed) { cf = new CalibrationForm(); cf.Show(); } cursorControl = false; calibrationState = 1; doCalibration(); }
public void doCalibration() { if (cf == null) return; int x = 0; int y = 0; int size = 25; Pen p = new Pen(Color.Red); switch (calibrationState) { case 1: x = (int)(screenWidth * calibrationMargin); y = (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 2: x = screenWidth - (int)(screenWidth * calibrationMargin); y = (int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 3: x = (int)(screenWidth * calibrationMargin); y = screenHeight -(int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 4: x = screenWidth - (int)(screenWidth * calibrationMargin); y = screenHeight -(int)(screenHeight * calibrationMargin); cf.showCalibration(x, y, size, p); dstX[calibrationState - 1] = x; dstY[calibrationState - 1] = y; break; case 5: //compute warp warper.setDestination(dstX[0], dstY[0], dstX[1], dstY[1], dstX[2], dstY[2], dstX[3], dstY[3]); warper.setSource(srcX[0], srcY[0], srcX[1], srcY[1], srcX[2], srcY[2], srcX[3], srcY[3]); warper.computeWarp(); cf.Close(); cf = null; calibrationState = 0; cursorControl = true; BeginInvoke((MethodInvoker)delegate() { cbCursorControl.Checked = cursorControl; }); saveCalibrationData(); UpdateTrackingUtilization(); break; default: break; } }