Labels in stretch renderer are not applied correctly when setting the renderer of a raster layer using a LYR file.
上次发布: March 27, 2015ArcGIS for Desktop
漏洞 ID 编号
NIM084408
已提交
September 5, 2012
上次修改时间
June 5, 2024
适用范围
ArcGIS for Desktop
找到的版本
10.0
编程语言
C#
操作系统
Windows OS
操作系统版本
7
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.
解决办法
After setting IRasterLayer::Renderer property with the IRasterRenderer reference obtained from the LYR file,e.g.rasterLayer.Renderer = rasterRenderer;... cast the IRasterRenderer reference returned by IRasterLayer::Renderer to IRasterStretchColorRampRenderer to adjust the labels of the raster renderer using the LabelHigh and LabelLow properties of IRasterStretchColorRampRenderer:e.g.rasterRenderer = rasterLayer.Renderer; //see note belowrasterStretchColorRampRenderer = rasterRenderer as IRasterStretchColorRampRenderer;rasterStretchColorRampRenderer.LabelHigh = rasterStretchColorRampRenderer.LabelHigh + "ft";rasterStretchColorRampRenderer.LabelLow = rasterStretchColorRampRenderer.LabelLow + "ft";Note: The user must first assign the renderer to the RasterLayer to get a new reference to IRasterRenderer from rasterLayer.Renderer before applying this change. The first reference to IRasterRenderer obtained from the LYR file is correct and does not need any adjustments. It is not until the first reference to IRasterRenderer is assigned to the RasterLayer that the renderer breaks and needs the adjustments.