private void mImageBoxPreview_MouseUp(object sender, MouseEventArgs e) { if (m_pKey != null && e.Button == MouseButtons.Left) { M_AV_PROPS props = new M_AV_PROPS(); m_pFrame.FrameAVPropsGet(out props); int nOrigPictureWidth = props.vidProps.nWidth; int nOrigPictureHeigth = Math.Abs(props.vidProps.nHeight); int nScaledImageX = e.X + mImageBoxPreview.HorizontalScroll.Value; int nScaledImageY = e.Y + mImageBoxPreview.VerticalScroll.Value; double dblScaleFactor = (double)nOrigPictureWidth / (double)mImageBoxPreview.ScaledImageWidth; int nOriginalImageX = (int)(nScaledImageX * dblScaleFactor); int nOriginalImageY = (int)(nScaledImageY * dblScaleFactor); object pFrame; string strConfig = "type='" + comboBoxDetectType.Text + "' max_keys='" + numericKeys.Value.ToString() + "'"; if (checkBoxExcludePts.Checked) { m_pKey.KeyExcludePoint(nOriginalImageX, nOriginalImageY, strConfig, out pFrame); } else { m_pKey.KeyAddPoint(nOriginalImageX, nOriginalImageY, strConfig, out pFrame); } UpdatePicture(pFrame); } }