private void adjustSliders() { checkForOverlap(); videoSlider.Value = (int)Math.Floor(MathFunctions.ValueToPercent(pictureGiver.RunFrom, pictureGiver.RunTo, actualPicture)); refreshActualFrame(); }
private void RunAnalysis() { actualState = state.runing; //TODO: move all file inicialiyation over here, especially Output... new Task(() => { foreach (Bitmap picture in pictureGiver) { if (actualState == state.stoped) { break; } //TODO: pausing handling - something better than active waiting for the switch of state. //Althought there is only one Task with the code, so the active waiting in paused state is not so big overhead... while (actualState == state.paused) { ; } proccesFrame(picture, Extensions.ActualizeBlobKeeper); printOut(pictureGiver.ActualIndex); videoSlider.crossThreadOperation(() => videoSlider.Value = (int)Math.Floor(MathFunctions.ValueToPercent(pictureGiver.RunFrom, pictureGiver.RunTo, actualPicture))); } MessageBox.Show($"Video analysis of {pictureGiver.Tag} completed.", "Analysis completed", MessageBoxButtons.OK, MessageBoxIcon.None); this.crossThreadOperation(() => Stop()); }).Start(); }