How to draw a text on an image and how to use this image as my custom pin icon?
I use the official code in the https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/map/
I can use the custom pin image as an icon to replace the standard google map pin, but I want to add text on this customized pin, then use my new pin (with the text) to my new customized pin icon.
Here is the code I used now
foreach (var pin in customPins)
{
var marker = new MarkerOptions ();
marker.SetPosition (new LatLng (pin.Pin.Position.Latitude, pin.Pin.Position.Longitude));
marker.SetTitle (pin.Pin.Label);
marker.SetSnippet (pin.Pin.Address);
marker.SetIcon (BitmapDescriptorFactory.FromResource (Resource.Drawable.pin));
}
so the maker SetIcon this method to get custom pin icon on my Rouscoure.Drawable folder. In this folder I stored my pin.png image.
I am struggling to draw text in my original pin image. Then, I also don't know how to use SetIcon or InvokeIcon to load my new image if I succeeded add text on my pin.
Any idea, help, I really appreciate.
Posts
fixed problem, thanks
Can u please tell me how you fixed it??
@keertanadapari For drawing ,you need a methond to do create canvas and paint, and combine it.
Check those.
http://stackoverflow.com/questions/41333472/how-to-draw-a-text-on-an-image-and-how-to-use-this-image-as-my-custom-pin-icon/41333532#41333532
http://stackoverflow.com/questions/40867783/how-to-set-a-different-image-for-each-pin-xamarin-ios