Hi there, how do I draw an image on the UltraGeographicMap control for WinForms?I've tried adding a DataTemplateRenderHandler() to a CustomRenderTemplate that I could assign to the MarkerTemplate of my series.
var template = new CustomRenderTemplate(); template.Render = new Infragistics.Portable.Components.Data.DataTemplateRenderHandler(renderHandler); highLightedSeries.MarkerTemplate private void renderHandler(DataTemplateRenderInfo target) { PropertyInfo info = target.Data.GetType().GetProperty("Item"); ShapefileRecord record = info.GetValue(target.Data, null) as ShapefileRecord; var highLightedSeries = new Infragistics.Win.DataVisualization.MarkerSeries(); ultraGeographicMap1.Series.Add(); }
I don't know if this would work, and if it would what the next steps are for actually assigning an image to be rendered.
Hello James,
I have been investigating into your requirement in this case, and I believe you are on the correct track to implementing this, as I would recommend using a CustomRenderTemplate for the MarkerTemplate of one of your series within the UltraGeographicMap, but it does not appear that your implementation of the CustomRenderTemplate is correct in this case.
In order to implement a CustomRenderTemplate, you need to provide a DataTemplateMeasureHandler and a DataTemplateRenderHandler for the Measure and Render properties of that object first. The DataTemplateMeasureHandler will set the size that you want the markers to render, and the DataTemplateRenderHandler will actually render the object using the Graphics object that is returned by the DataTemplateRenderInfo parameter of the handler. To render an image, you can use that Graphics’ DrawImage method.
I am attaching a sample project to demonstrate the above to you. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
WFGeographicMapImages.zip