I am writing an application in C# and I need to get the X & Y screen coordinates from a marker inside the GMAP.net map control so I can plot an overlay above the control. The overlay is for generating a heatmap (the overlay is a transparent picturebox).
Here is what I have so far but it is not doing anything useful.
private void generateBitmap(List<GMapMarker> markers)
{
HeatPoints.Clear();
foreach (GMapMarker m in markers)
{
GPoint px = gMapControl1.MapProvider.Projection.FromLatLngToPixel(m.Position, (int)gMapControl1.Zoom); // I was expecting this to give me xy screen coords
HeatPoints.Add(new HeatPoint((int)px.X, (int)px.Y, eventIntensity(JsonConvert.DeserializeObject<WalkSafe.ReportEvent>(m.Tag.ToString()))));
}
Bitmap map = new Bitmap(heatImage.Width, heatImage.Height);
heatImage.Image = heatlib.CreateIntensityMask(map, HeatPoints);
}
Any help would be greatly appreciated :)