Is possible to know if tiles is loaded without the event completed ?? (Printed image tiles is blank)

Topics: Help
Aug 16, 2013 at 5:42 PM
Edited Aug 16, 2013 at 5:45 PM
I want to print different image of the map, but the image is blank because the tile doesn't have the time to load.
            GMapControl1.ZoomAndCenterRoute(m_route)
            bigimg = GMapControl1.ToImage()

            GMapControl1.ZoomAndCenterMarkers("OverlayOne")
            GMapControl1.Zoom -= 4

            aimg = GMapControl1.ToImage()

            GMapControl1.ZoomAndCenterMarkers("OverlayTwo")
            GMapControl1.Zoom -= 4
            bimg = GMapControl1.ToImage()
Is there any way to know if the tile is loaded without working with the event ?

I would love to make this
GMapControl1.ZoomAndCenterMarkers("OverlayOne")
GMapControl1.Zoom -= 4
GMapControl1.WaitTilesToLoad
aimg = GMapControl1.ToImage()
Coordinator
Aug 16, 2013 at 5:56 PM
check the static image demo
Aug 16, 2013 at 6:46 PM
Edited Aug 16, 2013 at 6:50 PM
OK, i find another solution but it's not really nice.

I understand that it's more of a caching problem so here what i did
            GMapControl1.ZoomAndCenterMarkers("OverlayOne")
            GMapControl1.Zoom -= 2
            For i As Integer = 0 To 20
                GMapControl1.Position = GMapControl1.Position
            Next


            aimg = GMapControl1.ToImage()

            GMapControl1.ZoomAndCenterMarkers("OverlayTwo")
            GMapControl1.Zoom -= 2
            For i As Integer = 0 To 20
                GMapControl1.Position = GMapControl1.Position
            Next

            bimg = GMapControl1.ToImage()
It's seem that the loop let the BG do his caching job for a while so the picture is loaded.
I did try to make it proper work with TileCompleted event but it doesn't work
I guess this code will generate blank tile anyway if the computer is really really fast.