private void DisplayImage() { frmImage frm; ImageService imgsvc = null; Bitmap bmp; string strName; // Display information about the selected image. try { imgsvc = new ImageService(); strName = maInfo[lstImages.SelectedIndex].Name; bmp = GetImage(imgsvc.GetImage(strName)); // Create a new image form instance. frm = new frmImage(); frm.Text = strName; frm.image = bmp; frm.ClientSize = new Size(bmp.Width, bmp.Height); frm.Show(); } catch (Exception exp) { MessageBox.Show(exp.Message, this.Text); } finally { imgsvc.Dispose(); } }
public void DBToolLibrary(string toolName) { switch (toolName) { case "SHPToSDE": SpatialDataBase.frmSHPToSDE frmSHP = new frmSHPToSDE(m_gcon, this.m_frmMian.OraCmd); frmSHP.ShowDialog(); m_frmMian.ShowSDETree(); break; case "RasterToSDE": SpatialDataBase.frmRasterToSDE frmRaster = new frmRasterToSDE(m_gcon, this.m_frmMian.OraCmd); frmRaster.ShowDialog(); m_frmMian.ShowSDETree(); break; case "Search": SpatialDataBase.frmSearchDB frmSearch = new frmSearchDB(m_gcon, this.m_mapControl, this.m_frmMian.OraCmd); frmSearch.ShowDialog(); break; //case "SheetMetaData": // SpatialDataBase.frmSheetMetaData frmMetaData = new frmSheetMetaData(m_workSpace, this.m_frmMian.OraCmd); // frmMetaData.Show(); // break; case "ImageManage": SpatialDataBase.frmImage frmIm = new frmImage(this.m_frmMian.OraCmd); frmIm.ShowDialog(); break; } }
private void btnPic_Click(object sender, EventArgs e) { frmImage frm = new frmImage(); frm.ShowDialog(); //to close the form this.DialogResult = DialogResult.OK; }