private void fillDialogWithData() { if (currentLayer != null) { this.settingsWhiteIsTP.Checked = currentLayer.WhiteIsTransparent; this.layerNameTextBox.Text = currentLayer.LayerName; this.layerCommentTextBox.Text = currentLayer.Comment; this.layerFileNameLabel.Text = currentLayer.FileName; this.layerFilePathLabel.Text = currentLayer.FilePath; this.layerShapeTypeLabel.Text = "Bild"; this.layerMinXLabel.Text = currentLayer.BoundingBox.Left.ToString(); this.layerMinYLabel.Text = currentLayer.BoundingBox.Bottom.ToString(); this.layerMaxXLabel.Text = currentLayer.BoundingBox.Right.ToString(); this.layerMaxYLayer.Text = currentLayer.BoundingBox.Top.ToString(); this.layerWidthLabel.Text = currentLayer.Width.ToString(); this.layerHeightLabel.Text = currentLayer.Height.ToString(); this.resXField.Text = currentLayer.ResolutionX.ToString(); this.resYField.Text = currentLayer.ResolutionY.ToString(); } else { MessageBox.Show("Fehler beim Lesen von Shape"); mainControler.addLogMessage("[LayerEdit] Fehler beim Lesen von Bild"); currentLayer = null; } }
public DialogResult ShowDialog(ImageLayer currentLayer) { this.currentLayer = currentLayer; fillDialogWithData(); return base.ShowDialog(); }
public ImageLayer addImageLayer(string FilePath) { CreateNewGDALContainer(mainControler.MapPanel.ClientSize.Width, mainControler.MapPanel.ClientSize.Height); GravurGIS.MapPanelBindings.ImageLayerInfo ilinfo = GDALAddImageToContainer(FilePath); if (ilinfo.id >= 0) { ImageLayer imageLayer = new ImageLayer(this, ilinfo, Path.GetFileName(FilePath), Path.GetDirectoryName(FilePath)); layerListViewMappingList.Add(LayerCount, LayerCount); // ListView-Index, Layer-Index layerArray.Add(imageLayer); if (LayerCount == 1) { this.firstScale = this.dFirstMapMeassure = 1; mainControler.createNewCanvas(ilinfo.minBX * firstScale, ilinfo.maxBY * firstScale, scale); mainControler.MapPanel.onLayerZoom(0); } addLayerPostProcessing(imageLayer); return imageLayer; } throw new ApplicationException("Konnte kein GeoBild Layer hinzufügen"); }