Within ArcObjects for ArcGIS 10.1, we are attempting to render pre-generated map tiles as a basemap (group) layer. The tiles themselves are of the typical web mercator aux. spherical tiling scheme.

Under ArcMap 10.1 the tiles do not render properly: incorrect rendering result

and the ArcMap 10.1 UI is displaying the following drawing error: "Missing raster band wavelength properties"

[Expected] rendering result under ArcMap 10.0: enter image description here

While this is related to this (my) question here, that was a holistic approach question. Here I am specifically asking how to properly render the tiles in ArcMap 10.1.

We successfully accomplished the layer adding/rendering within 10.0 via the following code:

_tileLayer = new MyCustomTileLayer();    // implements ILayer among others..
_coverageBasemapLayer = new BasemapLayerClass();
_coverageGroupLayer = _coverageBasemapLayer as IGroupLayer;

// add the layer to the map
IMap map = ArcMap.Document.FocusMap;


// wire the AfterDraw Event
IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as IActiveViewEvents_Event;
avEvent.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(avEvent_AfterDraw);

private void avEvent_AfterDraw(IDisplay Display, esriViewDrawPhase phase) {
    // force re-draw
    _tileLayer.Draw(esriDrawPhase.esriDPGeography, Display, null);


// effectively, within _tileLayer.Draw() here...
IRasterLayer rl = new RasterLayerClass();
// 'file' is the full path to the map tile PNG on the local file system, downloaded
// and/or cached


Presumably many things have changed within the renderer for 10.1. However can anyone provide insight into the ArcObjects changes required? Specifically how can we [properly] accomplish this within ArcObjects under 10.1?

Thank you in advance.

  • What format are the tiles? PNG24? 32? I noticed that PNG32 alpha transparency in map services seems to not work in ArcMap 10.0 but does work in 10.1. Maybe related? – blah238 Apr 10 '13 at 17:50
  • are the tiles coming from an arcgis server tiled mapservice ? – Kirk Kuykendall Apr 10 '13 at 18:45
  • @blah238 the tiles are PNG32, there is an alpha channel. – Josh Apr 10 '13 at 19:23
  • @Kirk, the tiles are not coming from an arcgis server tiled mapservice, but our own tile server. – Josh Apr 10 '13 at 19:25
  • Then I suspect the visual difference is in how ArcMap 10.0 handles PNG alpha channels vs. how 10.1 does. I have no idea about the error message though. 10.1 does it the "right" way though. – blah238 Apr 10 '13 at 19:32

In 10.1 the StretchType for rasters seems to have changed from esriRasterStretch_NONE to "Percent Clip" giving color problems with 24 and 32 bits tiles.

I have resolved it with the following code:

var image = new Bitmap(file, true);
var format = image.PixelFormat;
if (format == PixelFormat.Format24bppRgb || format == PixelFormat.Format32bppArgb || format == PixelFormat.Format32bppRgb)
    var rasterRGBRenderer = new RasterRGBRendererClass();
    ((IRasterStretch2rasterRGBRenderer).StretchType =
    rl.Renderer = rasterRGBRenderer;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.