Converting Lat/Long to x,y Pixels

Anonymous
09-02-2004, 06:12 PM
Hi all:

I have a number of pushpins with their associated lat/long values within mappoint. I want to select a map portion and copy it to the clipboard. I will know the four corners of the map's lat/long coordinates. I will also know the altitude. After I save the map from the clipboard memory as a bitmap or jpeg, I would like to somehow convert the Lat/Long pushpins into x,y coordinates. The lat/long will change periodically and I need an algorithm that will yield good x,y pixel values taking into account the earth's curvature etc.

Any help would be appreciated.

Thanks
Robert

Gryffyn
09-08-2004, 01:37 PM
Ok, so you're generating a map and saving it as an image somewhere.

When you say that you want to convert lat/long to X,Y coords, are you talking about X,Y coords within the map you generated I assume?

You can get the location object of the lat/long you have with the GetLocation method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappoint2004/BIZOMMGetLocation.asp

Then you might look into the LocationToX and LocationToY methods:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappoint2004/BIZOMMLocationToX.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappoint2004/BIZOMMLocationToY.asp


This should give you the X,Y coords of the locations you have visible on your map.

Did that helps?

-TG

Anonymous
09-08-2004, 04:24 PM
Hello TG:

I will try your recommendations. I will post once I get answers. :?:

Thanks
Robert

 
Web mp2kmag.com
mapforums.com