MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Create gif file from mappoint

This is a discussion on Create gif file from mappoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello everybody, I'm using visual basic to create a gif file from an object location in mappoint. I successfully created ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 05-03-2006
Junior Member
Yellow Belt
 
Join Date: May 2006
Posts: 12
Send a message via ICQ to giaarcix Send a message via MSN to giaarcix
Create gif file from mappoint

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
__________________
Bisogna sognare, insistere, ripetere, finchè il sogno si trasformi in realtà
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 05-04-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Use CopyMap method. this copies the map to Clipboard. Then you have control yourself on what to do with it as fast as possible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 05-05-2006
Junior Member
Yellow Belt
 
Join Date: May 2006
Posts: 12
Send a message via ICQ to giaarcix Send a message via MSN to giaarcix
great... but there is another problem...

Hello! Thank you very much: it worked fine and it takes much less time.
This is the code I used:

objLoc.GoTo
Clipboard.Clear
oMap.CopyMap
SavePicture Clipboard.GetData(), "c:\temp.gif"

The problem now is this: with the first (html) method I created a gif file with format 460x460 pixels that was about 30 or 40 kbytes.
With the second method (clipboard) the same gif becomes about 600 kbytes!
Is there a way to tell mappoint to save to the clipboard in low resolution (or something like this)?
If the only way is creating another function that lowers the resolution of my file I suppose it would take the same or more time than creating the gif through the html page...
Any help will be appreciated!
Thank you again,
Giacomo
__________________
Bisogna sognare, insistere, ripetere, finchè il sogno si trasformi in realtà
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2006
Junior Member
Yellow Belt
 
Join Date: May 2006
Posts: 12
Send a message via ICQ to giaarcix Send a message via MSN to giaarcix
other question

Ok, I have understood another thing: the method I used (SavePicture Clipboard.GetData(), "c:\temp.gif") always saves the mappoint image as a BMP file and not a GIF.
So I think the right question should be: is there a way to make VB save my image in other format than BMP?
Thank you again,
Giacomo
__________________
Bisogna sognare, insistere, ripetere, finchè il sogno si trasformi in realtà
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-06-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Yes you are right. Copy to clipboard is a bitmap image of the data. The formats you describe like bmp, gif, jpg, etc are file formats. They have eventually compressed methods with or without data loss.

So indeed it is VB that has to have a function to save a bitmap to a gif or any other file format. But you loosing me My native language is object pascal, C#, Flemish and a little English, so I cannot help. But sure others will drop in here !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 12-07-2007
Junior Member
White Belt
 
Join Date: Dec 2007
Posts: 1
Re: Create gif file from mappoint

i tried this code in VBA, but VBA does not know "Clipboard", so how do I do this in VBA?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 12-08-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Re: Create gif file from mappoint

Hi,

Then you have to call the windows API functions. This is possible in any language, but I have no idea how to do this in VBA. Hope someone else will drop in here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
create, file, gif, mappoint


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/create-gif-file-mappoint-4940.html

Posted By For Type Date
file gif travel | VIRGILIO Ricerca | Web This thread Refback 09-26-2008 05:36 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to create a file per customer and how to search. tlpike2 MapPoint 2006/2009 Discussion 2 10-21-2005 02:11 PM
How to create map file ( image_map.gif ) of given fix size.? Anonymous MapPoint 2006/2009 Discussion 2 06-24-2004 06:36 PM
I am new to MapPoint and am trying to create a dat.... Anonymous MapPoint 2006/2009 Discussion 1 11-29-2001 08:07 AM
Does Mappoint allow you to create territories with.... Anonymous MapPoint 2006/2009 Discussion 1 10-31-2001 01:08 PM
I am using MapPoint 2002 to create a map of our sa.... Anonymous MapPoint 2006/2009 Discussion 1 10-10-2001 02:06 PM


All times are GMT -5. The time now is 02:31 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59