private void button2_Click(object sender, EventArgs e) { radioButton1.Checked = true; IScreenDisplay display = frmRotate_active.ScreenDisplay; display.TrackRotate(); IDisplayTransformation trans = display.DisplayTransformation; comboBox1.Text = Math.Round(trans.Rotation, 2).ToString(); }
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e) { //旋转 if (frm_Rotate.flag == 1) { IScreenDisplay display = axMapControl1.ActiveView.ScreenDisplay; display.TrackRotate(); } //裁剪 if (Is_clip == true) { IRgbColor pcolor = new RgbColorClass(); pcolor.Red = 255; pcolor.Blue = 0; pcolor.Green = 255; ISimpleFillSymbol linesymbol = new SimpleFillSymbolClass(); linesymbol.Color = pcolor; //ISymbol symbol = linesymbol as ISymbol; object symbol = linesymbol; IGeometry geom = axMapControl1.TrackPolygon(); //IScreenDisplay display = axMapControl1.ActiveView.ScreenDisplay; //display.StartDrawing(display.hDC, (short)esriScreenCache.esriAllScreenCaches); //display.SetSymbol(symbol); //display.DrawPolygon(geom); //display.FinishDrawing(); axMapControl1.DrawShape(geom, ref symbol); //方法一 IRasterLayer rasterlayer = axMapControl1.get_Layer(0) as IRasterLayer; IGeoDataset geodataset = rasterlayer as IGeoDataset; geom.SpatialReference = geodataset.SpatialReference; RasterClip(rasterlayer, geom as IPolygon); Is_clip = false; axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null); } }