In Desktop 2.0, you could create a PointStyle with a PointStyleEnum.BitMap and associate with it a BitMap where you had called BitMap.MakeTransparent() on the bitmap.
Now, with a GeoImage, I don't seem to be able to interact with the BitMap at that level.
Is there an API call I'm missing, or do I need to modify all my bmp files? thanks, -jeff
Jeff
Thanks for your post.
I am sorry to say that we do not have this API in GeoImage Level. While following ways can let you go around this problem easily:
Bitmap bitmap =new Bitmap( @"..\..\SampleData\Data\United States.png");
bitmap.MakeTransparent(Color.Black);
MemoryStream stream = new MemoryStream();
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
GeoImage geoimage = new GeoImage(stream);
InMemoryFeatureLayer bitmapLayer = new InMemoryFeatureLayer(); bitmapLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType = PointType.Bitmap;
bitmapLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image = geoimage;
bitmapLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
bitmapLayer.InternalFeatures.Add("Crossing", new Feature(new PointShape(-95.2806, 38.9554)));
Any more questions just feel free to let me know.
Thanks.
Yale
Thanks very much, Yale! That will do just great - I’ll check for png, if not present, open bmp, set transparent, save to stream, file (as png) so it will be there next time around.
-jeff
Jeff,
You are welcome. Sorry for the lacking of the API causing the problem.
Any more questions just feel free to let me know.
Thanks.
Yale