private void Form1_Load(object sender, System.EventArgs e) { m_tocControl = (ITOCControl)axTOCControl1.Object; //Set buddy control m_tocControl.SetBuddyControl(axPageLayoutControl1); //Get the directory of the executable m_tempDir = System.Reflection.Assembly.GetExecutingAssembly().Location; m_tempDir = Path.GetDirectoryName(m_tempDir); //The location to save the temporary metadata m_tempFile = m_tempDir + "metadata.htm"; //Add style sheets to the combo box cboStyleSheets.Items.Insert(0, @"Brief.xsl"); cboStyleSheets.Items.Insert(1, @"Attributes.xsl"); cboStyleSheets.Items.Insert(2, @"DataDictionTable.xsl"); cboStyleSheets.Items.Insert(3, @"DataDictionPage.xsl"); cboStyleSheets.SelectedIndex = 0; }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { // TODO: Add CmdRasterTransZ.OnClick implementation IMapControl3 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl3; if (pMapCtr != null) { FrmRasterTransZ m_frmRasterTranZ = new FrmRasterTransZ(); if (m_frmRasterTranZ.ShowDialog() == DialogResult.OK) { if (m_frmRasterTranZ.istrue == true) { ClsRasterOp pRasterOp = new ClsRasterOp(); IRaster2 pRaster2 = pRasterLayer.Raster as IRaster2; IRasterDataset2 pRasterDataset = pRaster2.RasterDataset as IRasterDataset2; pRasterOp.ChangeRasterValue(pRasterDataset, m_frmRasterTranZ.a, m_frmRasterTranZ.b); //此处要判断图层是否存在金字塔,如果存在则需要重新创建 IRasterPyramid3 pDstRasterPyramid3 = pRasterDataset as IRasterPyramid3; if (pDstRasterPyramid3.Present) { IDataLayer2 pDataLayer = pRasterLayer as IDataLayer2; pDataLayer.Disconnect(); pDstRasterPyramid3.DeletePyramid(); pDstRasterPyramid3.Create(); pRasterLayer.CreateFromDataset(pRasterDataset); } //更新图层渲染方式 ChangeStrechRender(pRasterLayer); pMapCtr.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); if (m_axTocControl != null) { m_axTocControl.SetBuddyControl(pMapCtr); m_axTocControl.Update(); m_axTocControl.ActiveView.Refresh(); } } } } }
private void Form1_Load(object sender, System.EventArgs e) { m_tocControl = (ITOCControl) axTOCControl1.Object; //Set buddy control m_tocControl.SetBuddyControl(axPageLayoutControl1); //Get the directory of the executable m_tempDir = System.Reflection.Assembly.GetExecutingAssembly().Location; m_tempDir = Path.GetDirectoryName(m_tempDir); //The location to save the temporary metadata m_tempFile = m_tempDir + "metadata.htm"; //Add style sheets to the combo box cboStyleSheets.Items.Insert(0, @"Brief.xsl"); cboStyleSheets.Items.Insert(1, @"Attributes.xsl"); cboStyleSheets.Items.Insert(2, @"DataDictionTable.xsl"); cboStyleSheets.Items.Insert(3, @"DataDictionPage.xsl"); cboStyleSheets.SelectedIndex = 0; }