Last post Sep 17, 2007 04:03 AM by alexdriver
Sep 17, 2007 04:03 AM|alexdriver|LINK
I'm trying to plot a number of postcodes onto a map of the UK (I could use Google Maps, but I'm trying to implement my own version).
I can convert the postcode to an x, y coordinate using the data from this website: http://www.easypeasy.com/guides/article.php?article=64
Using this piece of code I can plot ellipses onto an image:
string mapURL = @"C:\Documents and Settings\adriver\Desktop\map.gif";
System.Drawing.Image img = System.Drawing.Image.FromFile(mapURL);
Bitmap b = new Bitmap(img);
Graphics g = Graphics.FromImage(b);
g.SmoothingMode = SmoothingMode.HighQuality;
Point coordinates = new Point;
coordinates = new Point(123, 501);
coordinates = new Point(52, 153);
coordinates = new Point(543, 257);
coordinates = new Point(345, 351);
coordinates = new Point(456, 456);
for (int x = 0; x < coordinates.Length; x++)
g.FillEllipse(Brushes.Green, coordinates[x].X - 3, coordinates[x].Y - 3, 6, 6);
b = null;
g = null;
Now my problem is: how do I convert the x, y coordinate of the postcode to the relevant area on the UK map?
Any help you can provide would be greatfully received.