//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); }
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)); }
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); } }