|
AE怎样读取栅格数据的属性值到二维数组中 ,调用下面这个函数时,需修改什么? public static System.Array RasterArray(IRaster raster, ref object novalue) {
IRasterProps props = (IRasterProps) raster;
novalue = props.NoDataValue;
IPnt pBlockSize = new PntClass();
pBlockSize.SetCoords((double) props.Width, (double) props.Height);
IRaster2 raster2 = (IRaster2) raster;
IPixelBlock pixelBlock = raster2.CreateCursorEx(pBlockSize).PixelBlock;
pBlockSize.SetCoords(0.0, 0.0);
raster.Read(pBlockSize, pixelBlock);
IPixelBlock3 block2 = (IPixelBlock3) pixelBlock;
return (System.Array) block2.get_PixelData(0);
}
|
|