private void btnRepresentingDevMagnitudeEnlarge_Click(object sender, EventArgs e)
        {
            MultipleScatterAndFunctionsRepresentation currentRenderer = accDeviationMagnitudeRenderer;

            if (sender == btnRepresentingDevAngleEnlarge)
            {
                currentRenderer = accDeviationAngleRenderer.Copy();
            }
            else if (sender == btnRepresentingDevDirectionEnlarge)
            {
                currentRenderer = accDeviationDirectionRenderer.Copy();
            }
            else if (sender == btnRepresentingDevMagnitudeEnlarge)
            {
                currentRenderer = accDeviationMagnitudeRenderer.Copy();
            }

            SimpleShowImageForm imgForm = new SimpleShowImageForm(currentRenderer.TheImage.CopyBlank().Bitmap);

            imgForm.FormResizing += new EventHandler((object resizingSender, EventArgs resizingEventArgs) =>
            {
                currentRenderer.ResizeCanvas(imgForm.pb1.Size);
                imgForm.UpdateBitmap(currentRenderer.TheImage.Bitmap);
            });
            imgForm.Show();
            currentRenderer.ResizeCanvas(imgForm.pb1.Size);
            imgForm.UpdateBitmap(currentRenderer.TheImage.Bitmap);
        }
Exemple #2
0
        private void ExternalGraphImageFormResized(object sender, EventArgs e)
        {
            BackgroundWorker    bgwGenerateGraphImage = new BackgroundWorker();
            SimpleShowImageForm f1 = sender as SimpleShowImageForm;

            bgwGenerateGraphImage.DoWork += (sndr, args) =>
            {
                ThreadSafeOperations.SetLoadingCircleState(wcUpdatimgGraph, true, true, wcUpdatimgGraph.Color);

                Image <Bgr, byte> img = FillGraphImage(f1.pb1.Size);
                args.Result = new object[] { img };
            };

            bgwGenerateGraphImage.RunWorkerCompleted += (sndr, args) =>
            {
                Image <Bgr, byte> resImg = (args.Result as object[])[0] as Image <Bgr, byte>;

                ServiceTools.ExecMethodInSeparateThread(this, delegate()
                {
                    f1.UpdateBitmap(resImg.Bitmap);
                });

                ThreadSafeOperations.SetLoadingCircleState(wcUpdatimgGraph, false, false, wcUpdatimgGraph.Color);
            };

            bgwGenerateGraphImage.RunWorkerAsync();
        }
Exemple #3
0
        private void pbGeoTrack_Click(object sender, EventArgs e)
        {
            if (geoRenderer == null)
            {
                return;
            }
            else if (geoRenderer.lTracksData.Count == 0)
            {
                return;
            }

            while (!Monitor.TryEnter(geoRenderer, 100))
            {
                Application.DoEvents();
                Thread.Sleep(0);
            }
            try
            {
                SimpleShowImageForm f1 = new SimpleShowImageForm((new Image <Bgr, byte>(new Size(800, 600))).Bitmap);
                f1.FormResizing += ExternalGeotrackImageFormResized;
                f1.Show();
                f1.UpdateBitmap(geoRenderer.RepresentTopo(f1.pb1.Size));
            }
            finally
            {
                Monitor.Exit(geoRenderer);
            }
        }
Exemple #4
0
        public void ExternalGeotrackImageFormResized(object sender, EventArgs e)
        {
            SimpleShowImageForm f1 = sender as SimpleShowImageForm;

            while (!Monitor.TryEnter(geoRenderer, 100))
            {
                Application.DoEvents();
                Thread.Sleep(0);
            }
            try
            {
                f1.UpdateBitmap(geoRenderer.RepresentTopo(f1.pb1.Size));
            }
            finally
            {
                Monitor.Exit(geoRenderer);
            }
        }