Ejemplo n.º 1
0
        private void btnMainThread_Click(object sender, EventArgs e)
        {
            RasterToVectorSettings rasterToVectorSettings = new RasterToVectorSettings();
            rasterToVectorSettings.ReadGeoCorners(windowSettings.leftXCoord,
                                                  windowSettings.leftYCoord,
                                                  windowSettings.rightXCoord,
                                                  windowSettings.rightYCoord);
            rasterToVectorSettings.sourceBmp = sourceBmp;
            rasterToVectorSettings.CalculateGeoPx();

            mapFactory = RasterToVectorRunner.RunRasterToVectorMainThread(rasterToVectorSettings);
            desinationImageCrooper = new VectorImageCrooper(new Size(sourcePanel.Width, sourcePanel.Height), mapFactory,
                                                            sourceImageCropper.centerX, sourceImageCropper.centerY, windowSettings);

            DrawCroppedScaledImage(float.Parse(ScaleTB.Text));
        }
Ejemplo n.º 2
0
        private void btnMainThread_Click(object sender, EventArgs e)
        {
            R2VSettings r2vSettings = new R2VSettings();
            r2vSettings.ReadGeoCorners(windowSettings.leftXCoord,
                                       windowSettings.leftYCoord,
                                       windowSettings.rightXCoord,
                                       windowSettings.rightYCoord);
            r2vSettings.sourceBmp = posterizedBmp;
            r2vSettings.CalculateGeoPx();
            r2vSettings.sliceWidth = windowSettings.sliceWidthVect;
            r2vSettings.sliceHeight = windowSettings.sliceHeightVect;
            r2vSettings.simplifyPhase1 = windowSettings.SimplifyPhase1();
            r2vSettings.simplifyPhase2 = windowSettings.SimplifyPhase2();
            r2vSettings.simplifyPhase3 = windowSettings.SimplifyPhase3();

            mapFactory = R2VRunner.RunR2VMainThread(r2vSettings, new UpdateInfoBoxTimeDelegate(UpdateInfoBoxTime));
            desinationImageCropper = new VectorImageCrooper(new Size(posterizedPanel.Width, posterizedPanel.Height), mapFactory,
                                                            posterizedImageCropper.centerX, posterizedImageCropper.centerY,
                                                            windowSettings, posterizedBmp);

            DrawCroppedScaledImage(float.Parse(txtScaleLvlVect.Text), UpdateInfoBoxTime);
        }
Ejemplo n.º 3
0
 private void panel7_SizeChanged(object sender, EventArgs e)
 {
     int panelSize = (int)Math.Round((panel7.Height - 8 - 10 - 8) / 2.0);
     sourcePanel.Height = panelSize;
     destinationPanel.Height = panelSize;
     sourceImageCropper = new RaserImageCrooper(new Size(sourcePanel.Width, sourcePanel.Height), sourceBmp);
     desinationImageCrooper = new VectorImageCrooper(new Size(sourcePanel.Width, sourcePanel.Height), mapFactory,
                                                     sourceImageCropper.centerX, sourceImageCropper.centerY, windowSettings);
     DrawCroppedScaledImage(float.Parse(ScaleTB.Text));
 }
Ejemplo n.º 4
0
 //metoda po wczytaniu pliku save inicjalizuje obraz źródłowy i czyści docelowy.
 //Buduje na nowo też obiekty sourceImageCropper i destinationImageCropper
 private void PrepareSourceImage(String aPath)
 {
     sourceBmp = new Bitmap(aPath);
     destinationBmp = null;
     sourceImageCropper = new RaserImageCrooper(new Size(sourcePanel.Width, sourcePanel.Height), sourceBmp);
     desinationImageCrooper = new VectorImageCrooper(new Size(destinationPanel.Width, destinationPanel.Height), mapFactory,
                                                     sourceImageCropper.centerX, sourceImageCropper.centerY, windowSettings);
 }
Ejemplo n.º 5
0
        private void ResizePanelPict()
        {
            int imagePanelHeight = (int)Math.Round((flpPictures.Height - 3 - 3 - 3 - 3) / 3.0);
            int imagePanelWidth = flpPictures.Width - 3 - 3;
            sourcePanel.Height = imagePanelHeight;
            posterizedPanel.Height = imagePanelHeight;
            destinationPanel.Height = imagePanelHeight;
            sourcePanel.Width = imagePanelWidth;
            posterizedPanel.Width = imagePanelWidth;
            destinationPanel.Width = imagePanelWidth;
            //posterizedPanel.Top = 5 + imagePanelHeight + 5;
            //destinationPanel.Top = 5 + imagePanelHeight + 5 + imagePanelHeight + 5;

            if (posterizedBmp != null)
            {
                sourceImageCropper = new RaserImageCrooper(new Size(sourcePanel.Width, sourcePanel.Height),
                                                               sourceImageCropper.centerX, sourceImageCropper.centerY, posterizedBmp);
                posterizedImageCropper = new RaserImageCrooper(new Size(posterizedPanel.Width, posterizedPanel.Height),
                                                               sourceImageCropper.centerX, sourceImageCropper.centerY, posterizedBmp);
                desinationImageCropper = new VectorImageCrooper(new Size(destinationPanel.Width, destinationPanel.Height), mapFactory,
                                                                posterizedImageCropper.centerX, posterizedImageCropper.centerY,
                                                                windowSettings, posterizedBmp);
                DrawCroppedScaledImage(float.Parse(txtScaleLvlVect.Text), UpdateInfoBoxTime);
            }
        }