Does anyone know if its possible to load a layer from .jp2 image format?
I tried but no luck.
Thanks
VW.
Does anyone know if its possible to load a layer from .jp2 image format?
I tried but no luck.
Thanks
VW.
Hi v,
There is a class Jpeg2000RasterLayer which is designed for .jp2 image file, you can try following sample code to test your data
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-118.098, 84.3, 118.098, -84.3);
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
Jpeg2000RasterLayer imageLayer = new Jpeg2000RasterLayer(@"..\..\SampleData\Data\World.jp2");
imageLayer.UpperThreshold = double.MaxValue;
imageLayer.LowerThreshold = 0;
LayerOverlay imageOverlay = new LayerOverlay();
imageOverlay.Layers.Add("ImageLayer", imageLayer);
winformsMap1.Overlays.Add(imageOverlay);
winformsMap1.Refresh();
Please let me know if you have any qustions.
Thanks
James
Hi James,
Thanks for that.. it works!
V.
Hi James,
I noticed that the Jpeg2000RasterLayer still uses Threshold instead of ZoomLevelSet. I will need to turn off this layer when its ZoomLevel05 or more. Do you know what are the thresholds for ZoomLevel 5??
Thanks.
V.
V,
You can use the following code to figure out any of the zoom levels.
ZoomLevelSet zoomLevelSet = new ZoomLevelSet();
double scale = zoomLevelSet.ZoomLevel05.Scale;
David
Thanks!
V,
You are welcome, please do not hestitate to let us know if you have any problems. We are alreays be ready to be with you to face them.
Thanks.
Yale