欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C# 利用IRawPixels接口遍歷柵格數(shù)據(jù)

 更新時(shí)間:2017年02月10日 11:22:49   作者:杰桀  
本文主要介紹了利用IRawPixels接口遍歷柵格數(shù)據(jù)。具有很好的參考價(jià)值,下面跟著小編一起來(lái)看下吧

AO的版本為10.2,開(kāi)發(fā)的語(yǔ)言是C#。柵格數(shù)據(jù)來(lái)源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);     
  }
}

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

最新評(píng)論