private void btnSelect_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Geo Image Files(*.IMG;*.TIF)|*.IMG;*.TIF"; dialog.Title = "Select a image files"; if (dialog.ShowDialog() == DialogResult.OK) { if (ImageGdal.IsValidImage(dialog.FileName)) { _Img = new ImageGdal(dialog.FileName); grpBxOptions.Enabled = true; btnSelectPath.Enabled = true; FuncStatusText(string.Format("Getting description\r\n{0}...", dialog.FileName)); pctBoxImg.Image = _Img.GetBitmap(pctBoxImg.Size, null, 0); ShowDescriptImg(); SetItemCmbOrder(); txtBxStatus.Text = ""; } else { txtBxStatus.Text = string.Format("Invalid Format image\r\n{0}", dialog.FileName); } } }
private void btPreview_Click(object sender, EventArgs e) { int[] Order = null; int SD = 0; if (ckOrder.Checked) { Order = new int[3]; Order[0] = (int)cmbBxBand1.SelectedItem; Order[1] = (int)cmbBxBand2.SelectedItem; Order[2] = (int)cmbBxBand3.SelectedItem; } if (ckStrech.Checked) { SD = (int)cmBxSD.SelectedItem; } pctBoxImg.Image = _Img.GetBitmap(pctBoxImg.Size, Order, SD); }