| | |
| | | { |
| | | times--; |
| | | if (TriggerSource == TriggerSource.Software) |
| | | { |
| | | Camera.GetImageWithSoftTrigger(out bitmap, timeout); |
| | | } |
| | | else |
| | | { |
| | | Camera.GetImage(out bitmap, timeout); |
| | | |
| | | } |
| | | if (bitmap != null) |
| | | { |
| | | break; |
| | | } |
| | | else if (isRegrab) |
| | | { |
| | | Debug.WriteLine($"取图失败,重新取图,剩余次数:{times}"); |
| | |
| | | } while (times > 0 && isRegrab); |
| | | |
| | | if (isUpParams) |
| | | { |
| | | Camera.SetCamConfig(oriConfig); |
| | | |
| | | } |
| | | OutputImage = bitmap; |
| | | } |
| | | |
| | |
| | | { |
| | | Result = true; |
| | | Msg = ""; |
| | | OutputImage = null; |
| | | |
| | | if (OutputImage != null) |
| | | { |
| | | if (OutputImage is Bitmap) |
| | | { |
| | | ((Bitmap)OutputImage).Dispose(); |
| | | } |
| | | OutputImage = null; |
| | | } |
| | | if (Record != null) |
| | | { |
| | | Record.Dispose(); |
| | | } |
| | | } |
| | | |
| | | public override void Dispose() |
| | | { |
| | | |
| | | return; |
| | | } |
| | | |
| | |
| | | if (OutputImage != null) |
| | | { |
| | | if (OutputImage is Bitmap) |
| | | { |
| | | obj.OutputImage = ((Bitmap)OutputImage).Clone(); |
| | | } |
| | | } |
| | | |
| | | return obj; |