Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Create gif file from mappoint 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à |
| |||
|
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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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à |
| |||
| 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à |
| |||
|
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
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Manchester Airport Flights
Looking for information about Manchester Airport flights? At Holiday Hypermarket we can show you where to look and how to book.
Travel Agent
Travel Counsellors was voted UK's Best Travel Agent at the Guardian Unlimited travel awards.
Holiday Jamaica
What springs to mind when you hear the word Jamaica? Bob Marley and Rum? Think again. Book a low cost holiday in Jamaica to explore this island for yourself.
Dubai Holidays
Dubai holidays provide you with exotic sights, desert safaris and superb cuisine. There is an extensive range of things to do and see!
Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.
Inclusive Holidays
At Travel.co.uk travel comparison will help you plan the perfect inclusive holidays.
Cheap Holidays to Florida
Cash strapped? Get info on cheap holidays to Florida at On The Beach.