AO的版本為10.2,開發的語言是C#。柵格數據來源IRasterDataset接口。
IRasterBandCollection pRasterBandCollection = pRasterDataset as IRasterBandCollection;IRasterBand pRasterBand = pRasterBandCollection.Item(0); IRaster pRaster = (pRasterDataset as IRasterDataset2).CreateFullRaster();IRawPixels pRawPixels = pRasterBand as IRawPixels;IRasterProps pRasterProps = pRasterBand as IRasterProps;int dHeight = pRasterProps.Height;int dWidth = pRasterProps.Width; IPnt pntSize = new PntClass();pntSize.SetCoords(dHeight, dWidth);IPnt pPixelBlockOrigin = new PntClass();pPixelBlockOrigin.SetCoords(0, 0);IPixelBlock pixelBlock = pRaster.CreatePixelBlock(pntSize);pRawPixels.Read(pPixelBlockOrigin, pixelBlock);System.Array arr = (System.Array)(pixelBlock as IPixelBlock3).get_PixelData(0);for (int i = 0; i < dHeight;i++ ) { for (int j = 0; j < dWidth; j++) { float number = 0; float.TryParse(arr.GetValue(i,j).ToString(),out number); }}
以上就是本文的全部內容,希望本文的內容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持VEVB武林網!
新聞熱點
疑難解答