Select to view content in your preferred language

ArcGISImageServiceLayer Issue

2415
4
01-03-2011 09:54 AM
AndyWright
Occasional Contributor
I created a series of Mosaic Datasets from ECW files that are sitting in a File Geodatabase.  I then created ArcGIS Server image services for each of them, which I then consume within a Silverlight 2.0 API application.  When I initially viewed these ArcGISImageServiceLayers in my SL app there was a black background that filled the remaining map extent around the image itself.  I'll attach an image of this so you can see what I mean.  I then discovered the NoData property on the ArcGISImageServiceLayer object.  I set that to 255 for all my image services and the black background went away ... for all but one of my image services.  I am no image expert, but I can't for the life of me figure out why this one image service is not cooperating.  I figured I'd post something out here and see if anyone has run into this sort of thing before and knows of a workaround.

It does not appear to be an issue with the Mosaic Dataset or the image service as I can preview both of them in ArcCatalog and ArcMap and the black background is nowhere to be found.  All signs point to this being a Silverlight or Silverlight API 2.0 issue.

Thanks in advance for any help you can provide for me on this ...

Andy
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor
The default image format for Image services is JPEG. Did you change the image format to PNG or PNGJPG which support transparency?
0 Kudos
AndyWright
Occasional Contributor
Morten,

I didn't change anything about the image format at all. I just created the Mosaic Dataset, added a raster to it (ECW file), then published it as an Image Service. I did 12 ECW files exactly the same way and only one of them is showing this black background.

I just added this code and I stll get the black background ...

mosaicLayer.Url = Url;
mosaicLayer.ImageFormat = ArcGISImageServiceLayer.ImageServiceImageFormat.PNG8;
Nullable<double> myNoData = 255;
mosaicLayer.NoData = myNoData;
0 Kudos
dotMorten_esri
Esri Notable Contributor
You are specifying White as transparent (255). Try and set it to '0' instead.

Do you see the same issue if you use the REST endpoint directly (ie outside of Silverlight)?
0 Kudos
AndyWright
Occasional Contributor
Yeh I actually tried 0 first and that makes all of my imagery take on that black background.  There is some white space around the imagery itself, which I believe represents the NoData area in the image.  I attached a screen shot of one of our images in the application so you can see that.  I think the black background is being put there by Silverlight because it doesn't know what to do with the rest of the map space outside of the bounding box of the image.  But why does this only happen for one of our 12 images? 

Morten, is there any way I can get you this image I'm having trouble with?  It's 18GB.
0 Kudos