ThinkGeo.com    |     Documentation    |     Premium Support

GeoImage DefaultPointStyle

I am trying to get images to display for points on a layer however I am having some difficulty getting the images to load.  I have pasted the code below that I am using to render the images.  I am having problems as it seems the .png format is not accepted.  This is the exception that I receive:  image Parameter name: The input GeoImage object is not a valid GeoImage type.  Can anybody see what I am doing wrong?


Here is the code:



ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(Application.CommonAppDataPath + "\\" + shapeFileName + ".shp", ShapeFileReadWriteMode.ReadOnly); 
layer.RequireIndex = false; 
layer.ZoomLevelSet.ZoomLevel14.DefaultPointStyle.PointType = PointType.Bitmap; 
layer.ZoomLevelSet.ZoomLevel14.DefaultPointStyle.Image = new GeoImage(Assembly.GetExecutingAssembly().GetManifestResourceStream("EPIC.Works.Resources." + assetType.AssetTypeResource)); 

// Create and set zoomlevel. 
layer.ZoomLevelSet.ZoomLevel14.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
Map.StaticOverlay.Layers.Add(layer); 


 


Thanks.


Curtis



Got it, not sure what the issue was but it seems to be resolved now. 
  
 Thanks. 
 Curtis

Curtis, 
  
 Thanks for keeping us updated.  
  
 Your code seems fine; just one small suggestion is that we don’t recommend setting the RequireIndex to false. It is fine if for a simple test; but for a real application, using the index file will greatly improve the performance. 
  
 Thanks, 
  
 Ben 


Ben,


Thanks and that is what it was there for, a simple test.  Was trying to figure out what was wrong with another issue.


Thanks.


Curtis



Curtis, 
  
 That’s fine. Let us know for any more queries. 
  
 Ben