C# 利用IRawPixels接口遍历栅格数据
程序员文章站
2022-05-31 16:52:32
ao的版本为10.2,开发的语言是c#。栅格数据来源irasterdataset接口。
irasterbandcollection prasterbandcoll...
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); } }
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!
上一篇: 什么是可视化响应式建站系统?