ArcGIS Engine 10 开发手册(8-27)拉伸
发布时间: 2018-02-04
所属分类: ArcGIS Engine 10 开发手册
本文通过代码演示如何进行拉伸。
示例代码
public IRasterRenderer StretchRenderer (ESRI.ArcGIS.Geodatabase.IRasterDataset pRasterDataset)
{
try
{
//Define the from and to colors for the color ramp.
IRgbColor pFromColor = new RgbColorClass ();
pFromColor.Red = 255;
pFromColor.Green = 0;
pFromColor.Blue = 0;
IRgbColor pToColor = new RgbColorClass ();
pToColor.Red = 0;
pToColor.Green = 255;
pToColor.Blue = 0;
//Create the color ramp.
IAlgorithmicColorRamp pRamp = new AlgorithmicColorRampClass ();
pRamp.Size = 255;
pRamp.FromColor = pFromColor;
pRamp.ToColor = pToColor;
bool createColorRamp;
pRamp.CreateRamp (out createColorRamp);
//Create a stretch renderer.
IRasterStretchColorRampRenderer pStretchRenderer = new RasterStretchColorRampRendererClass ();
IRasterRenderer pRasterRenderer = (IRasterRenderer) pStretchRenderer;
//Set the renderer properties.
IRaster pRaster = pRasterDataset.CreateDefaultRaster ();
pRasterRenderer.Raster = pRaster;
pRasterRenderer.Update ();
pStretchRenderer.BandIndex = 0;
pStretchRenderer.ColorRamp = pRamp;
//Set the stretch type.
IRasterStretch pStretchType = (IRasterStretch) pRasterRenderer;
pStretchType.StretchType =
esriRasterStretchTypesEnum.esriRasterStretch_StandardDeviations;
pStretchType.StandardDeviationsParam = 2;
return pRasterRenderer;
} catch (Exception ex)
{
}
}
ArcGIS Engine 10 开发手册全集
ArcGIS Engine 10 开发手册全集: ArcGIS Engine 10 开发手册
相关阅读
声明
1.本文所分享的所有需要用户下载使用的内容(包括但不限于软件、数据、图片)来自于网络或者麻辣GIS粉丝自行分享,版权归该下载资源的合法拥有者所有,如有侵权请第一时间联系本站删除。
2.下载内容仅限个人学习使用,请切勿用作商用等其他用途,否则后果自负。
手机阅读
公众号关注
知识星球
手机阅读
最新GIS干货
私享圈子