Hi Rui,
Thanks for your advice, which indeed decrease the size of the image. In my mind, this is weird, PNG isn’t a lossy format. Do you know the reason?
Now let’s turn back to your question “Define the quality when using PNG format”. As far as I know, you mean the quality of Cached image generated by TileCache, right? That’s a hard and complex stuff now, because the LayerOverlay used the ServerCache as property instead of TileCache.
One way is that we can overwrite the TileResourceSingleThread class, but it requires us to re-write all the logic about generating images. That’s very complex, I think.
Regarding the “Black background” issue, I was unable to recreate it, can you check whether you delete all the cached images before a new try? Here as following is my test code.
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.StandardColors.White);
Map1.CurrentExtent = new RectangleShape(-80.5, 68.9, 80, -60.43);
Map1.MapUnit = GeographyUnit.DecimalDegree;
MrSidRasterLayer sidImageLayer = new MrSidRasterLayer(MapPath(@"~\SampleData\World\World.sid"));
sidImageLayer.UpperThreshold = double.MaxValue;
sidImageLayer.LowerThreshold = 0;
Map1.StaticOverlay.ServerCache.CacheDirectory = "d:\\Temp";
Map1.StaticOverlay.ServerCache.CacheId = "MRSid";
Map1.StaticOverlay.Layers.Add(sidImageLayer);
Please check whether there is something different with yours.
Thanks,
Johnny