Hi, i write the following code for stream loading GdiPlusRasterLayer
but, no image is being drawn. Am i missing anything?
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
wpfMap.MapUnit = GeographyUnit.DecimalDegree;
LayerOverlay rootOverlay = new LayerOverlay();
GdiPlusRasterLayer rootImageLayer = new GdiPlusRasterLayer(@"Images\root1.jpg", new RectangleShape(-122, 74, 106, -62));
((GdiPlusRasterSource)rootImageLayer.ImageSource).StreamLoading += new EventHandler<StreamLoadingEventArgs>(MainWindow_StreamLoading);
rootImageLayer.UpperThreshold = double.MaxValue;
rootImageLayer.LowerThreshold = 0;
rootOverlay.Layers.Add(rootImageLayer);
wpfMap.Overlays.Add(rootOverlay);
wpfMap.CurrentExtent = new RectangleShape(-122, 74, 106, -62);
wpfMap.Refresh();
}
void MainWindow_StreamLoading(object sender, StreamLoadingEventArgs e)
{
e.AlternateStream = new FileStream(@"Images\root1.jpg", FileMode.Open, FileAccess.Read);
}