Icemark contains a nice screen-by-screen map which was ideal for my purposes. I took a look at the HTML and found that the actual map was secretly embedded (more later!) I was absolutely delighted! But first; how to get the images?
I wrote a little tool using Visual Studio and C# to grab the images from the remote web site. Because this tool was a one-off and I was the only user, it didn’t have to be fancy. In fact, just running the program did the work. I created several routines, that I’ll cover in later posts, to grab various bits of information.
Very simply, here’s how I grabbed all the images:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | private void GetImages() { for (int i = 0; i < 48; i++) { string imgString = i < 10 ? "0" + i : i.ToString(); string url = "http://www.icemark.com/spectrum/sabrewulf/map/" + imgString + ".gif"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream resStream = response.GetResponseStream(); Image img = Image.FromStream(resStream); img.Save(@"C:\sabrewulf\" + imgString + ".png", ImageFormat.Png); } } |