giaarcix
05-03-2006, 06:06 AM
Hello everybody,
I'm using visual basic to create a gif file from an object location in mappoint.
I successfully created my gif file by creating a temporary web page and then saving the related gif file.
My problem is that this operation takes a lot of time. I would like to know if there is a way to create directly the gif file without creating the webpage. Thank you very much for any help!
This is my source code:
Private Sub create_gif(latitute As Double, longitude As Double)
'INITIALIZATION OF MAPPOINT CONTROL
Dim oMap As MapPointctl.Map
Dim oWebPage As MapPointctl.SavedWebPage
Dim objLoc As MapPointctl.Location
MappointControl1.NewMap geoMapEurope
'I CREATE A TEMPORARY WEB PAGE (THIS CREATES ALSO THE GIF FILE)
Set oMap = MappointControl1.ActiveMap
Set objLoc = oMap.GetLocation(latitute, longitude, 100)
Set oWebPage = oMap.SavedWebPages.Add(filename:="c:\temp.htm", Location:=objLoc)
oWebPage.Save
'I SAVE THE GIF FILE SOMEWHERE IN MY COMPUTER
FileCopy "c:\temp_files\image_map.gif", "c:\test.gif"
'I DELETE THE TEMPORARY WEBPAGE
Dim fso As FileSystemObject
Set fso = New FileSystemObject
fso.DeleteFolder "c:\temp_files", True
Kill ("c:\temp.htm")
End Sub
I'm using visual basic to create a gif file from an object location in mappoint.
I successfully created my gif file by creating a temporary web page and then saving the related gif file.
My problem is that this operation takes a lot of time. I would like to know if there is a way to create directly the gif file without creating the webpage. Thank you very much for any help!
This is my source code:
Private Sub create_gif(latitute As Double, longitude As Double)
'INITIALIZATION OF MAPPOINT CONTROL
Dim oMap As MapPointctl.Map
Dim oWebPage As MapPointctl.SavedWebPage
Dim objLoc As MapPointctl.Location
MappointControl1.NewMap geoMapEurope
'I CREATE A TEMPORARY WEB PAGE (THIS CREATES ALSO THE GIF FILE)
Set oMap = MappointControl1.ActiveMap
Set objLoc = oMap.GetLocation(latitute, longitude, 100)
Set oWebPage = oMap.SavedWebPages.Add(filename:="c:\temp.htm", Location:=objLoc)
oWebPage.Save
'I SAVE THE GIF FILE SOMEWHERE IN MY COMPUTER
FileCopy "c:\temp_files\image_map.gif", "c:\test.gif"
'I DELETE THE TEMPORARY WEBPAGE
Dim fso As FileSystemObject
Set fso = New FileSystemObject
fso.DeleteFolder "c:\temp_files", True
Kill ("c:\temp.htm")
End Sub