public void Adjust() { IRasterGeometryProc proc = new RasterGeometryProc(); proc.Reset(this.irasterLayer_0.Raster); if (this.DestPointCollection.PointCount == 1) { IPoint point = this.SourcePointCollection.get_Point(0); IPoint point2 = this.DestPointCollection.get_Point(0); double deltaX = point2.X - point.X; double deltaY = point2.Y - point.Y; proc.Shift(deltaX, deltaY, this.irasterLayer_0.Raster); } else if (this.DestPointCollection.PointCount == 2) { proc.TwoPointsAdjust(this.SourcePointCollection, this.DestPointCollection, this.OperatorLayer.Raster); } else if (this.DestPointCollection.PointCount >= 3) { proc.Warp(this.SourcePointCollection, this.DestPointCollection, this.GeoTransType, this.OperatorLayer.Raster); } proc.Register(this.OperatorLayer.Raster); proc = null; if (this.m_HookHelper.FocusMap != null) { (this.m_HookHelper.FocusMap as IActiveView).Refresh(); } }
public void Save() { IRasterProps props = (IRasterProps)this.irasterLayer_0.Raster; if (this.m_HookHelper.FocusMap != null) { props.SpatialReference = this.m_HookHelper.FocusMap.SpatialReference; } IRasterGeometryProc proc = new RasterGeometryProc(); IRaster pRaster = this.irasterLayer_0.Raster; (this.irasterLayer_0 as IDataLayer2).Disconnect(); proc.Register(pRaster); this.irasterLayer_0.CreateFromRaster(pRaster); this.DestPointCollection.RemovePoints(0, this.DestPointCollection.PointCount); this.SourcePointCollection.RemovePoints(0, this.SourcePointCollection.PointCount); if (this.m_HookHelper.FocusMap != null) { (this.m_HookHelper.FocusMap as IActiveView).PartialRefresh(esriViewDrawPhase.esriViewGeography, this.OperatorLayer, null); } }