Synchronous image capture [CaptureScreenShot]

Dear friends,

I have difficulties with the CaptureScreenShot method using TMSFNCGoogleMap in Firemonkey. I am working with a TTabControl, basically in a tab I have a TMSFNCGoogleMap and in a different tab I have a Timage where I want to take the image capture of the map.

The issue is that when I try to capture the image of a TMSFNCGoogleMaps in a TImage, I can't synchronize that the previous actions on the map are reflected in my capture. For example, before switching tabs, I do the following, but still the markers appear in the capture. When I go back to the map, they have disappeared.

for x:= 0 to TMSFNCMaps1.Markers.Count-1 do
   TMSFNCMaps1.Markers[x].Visible := false;

Even if I do something like this TMSFNCMaps1.Options.ShowZoomControl := false, I get the image capture fails and the Timage control is not updated.

I don't know if there is a better way to capture the map image effectively, knowing that the previous tasks have been run on the map.

Hello friends,

Finally, I've been able to solve this issue by using sleep (800) and application.processmessages for marker clearing, before running the map capture, plus a BeginUpdate and EndUpdate through the control that hosted the map. So that's solved.

Anyway, if there was any way to capture images synchronously, that's always good to know. Thanks as always.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.