ThinkGeo.com    |     Documentation    |     Premium Support

Valid GeoCanvas.ToGeoImage formats

Greetings,


GeoCanvas.ToGeoImage accepts an arguement of type object which it converts to a GeoImage.  I have found that passing in a BitmapImage or BitmapSource causes the ToGeoImage throw an ArguementException saying nativeImage cannot be null (it is not being passed in as null).  What object types does ToGeoImage accept, and is there any plans to accept a BitmapImage or BitmapSource in the future?


Thanks,


Ryan



Ryan,


Thanks for your post and questions.
 
Up to now, we have not fully developed the WpfGeoCanvas, so if you are using the GdiPlusGeocanvas to use this API, it will cause the problem you are talking about:
 
In fact, the parameter should be instance of the subclass from following .net GDI+ classes:
System.Drawing. Image
 
One way to go around this to transfer the BitmapSource to bitmap and then passed in.
blogs.msdn.com/llobo/archive...terop.aspx
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale