How to draw a text on an image and how to use this image as my custom pin icon?

DonCB2BDonCB2B USMember ✭✭✭

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.

Best Answer

Answers

Sign In or Register to comment.