Saddam,
You have to be aware that the sample in the Code Community is in the Services Edition using MapSuiteCore.dll and not any version specific dll. If you are in the Descktop Edition you need to get rid of the DrawImage function and instead use the Desktop specific LayerOverlays. See the code below where I have Street Intersection working with the Desktop Edition. Notice that I commented out the Services edition with mapEngine lines. And do not use DrawImage function.
//mapEngine..CurrentExtent = new RectangleShape(-97.7402, 30.2793, -97.7284, 30.2738);
winformsMap1.CurrentExtent = new RectangleShape(-97.7402, 30.2793, -97.7284, 30.2738);
//mapEngine.BackgroundFillBrush = new GeoSolidBrush(GeoColor.StandardColors.LightGoldenrodYellow);
winformsMap1.BackColor = Color.LightGoldenrodYellow;
ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(@"C:\ThinkGeo\Support\Posts\10028\data\austinstreets.shp");
streetLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.LocalRoad2;
streetLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//Gets the features according to the street name.
streetLayer.Open();
Collection<Feature> features1 = streetLayer.FeatureSource.GetFeaturesByColumnValue("FENAME", "Red River"); //"Speedway");
Collection<Feature> features2 = streetLayer.FeatureSource.GetFeaturesByColumnValue("FENAME", "15th"); //"Martin Luther King Jr");
streetLayer.Close();
//InMemoryFeatureLayer for displaying the street candidates and the intersection point.
InMemoryFeatureLayer intersectionInMemoryFeatureLayer = new InMemoryFeatureLayer();
intersectionInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.LightPink, 3, true);
intersectionInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.StandardColors.Red, 12);
intersectionInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//Adds the street candidates feature and the intersection point feature to the InMemoryFeatureLayer
intersectionInMemoryFeatureLayer.Open();
intersectionInMemoryFeatureLayer.EditTools.BeginTransaction();
Collection<MultilineShape> multiLineShapes1 = new Collection<MultilineShape>();
Collection<MultilineShape> multiLineShapes2 = new Collection<MultilineShape>();
foreach (Feature feature1 in features1)
{
MultilineShape multiLineShape = feature1.GetShape() as MultilineShape;
multiLineShapes1.Add(multiLineShape);
intersectionInMemoryFeatureLayer.EditTools.Add(new Feature(multiLineShape));
}
foreach (Feature feature2 in features2)
{
MultilineShape multiLineShape = feature2.GetShape() as MultilineShape;
multiLineShapes2.Add(multiLineShape);
intersectionInMemoryFeatureLayer.EditTools.Add(new Feature(multiLineShape));
}
//Gets the intersection point (or points if this is the case)
intersectionInMemoryFeatureLayer.EditTools.Add(new Feature(GetIntersectionPoints(multiLineShapes1, multiLineShapes2, 50, DistanceUnit.Meter, GeographyUnit.DecimalDegree)));
intersectionInMemoryFeatureLayer.EditTools.CommitTransaction();
intersectionInMemoryFeatureLayer.Close();
//mapEngine.StaticLayers.Add("StreetLayer", streetLayer);
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("StreetLayer",streetLayer);
winformsMap1.Overlays.Add(staticOverlay);
//mapEngine.DynamicLayers.Add("Intersection", intersectionInMemoryFeatureLayer);
LayerOverlay dynamicOverlay = new LayerOverlay();
dynamicOverlay.Layers.Add("Intersection", intersectionInMemoryFeatureLayer);
winformsMap1.Overlays.Add(dynamicOverlay);
winformsMap1.Refresh();