Drawing a big topographic map in its own coordinates
-
Hi, I have got a big topographical jpg file that I want to display in a form on a picturebox in its real coordinates that ranges X from 50 000 to 75 000 and Y from 2 800 000 to 2 825 000. this will make it very easy for me to get the mouse coords in real coords as the user invokes the Mousedown event. It will also make it easier for me to draw real features in its real coordinates. I have got the code:
Image image = Image.FromFile(@"C:\Images\2529DA.jpg");
Pen myPen = new Pen(Color.Black);
Graphics formGraphics = this.picGrid.CreateGraphics();
formGraphics.Clear(picGrid.BackColor);formGraphics.DrawImage(image,0,0,1000, 1000);This shows the topomap nicely on the screen but with the local picturebox coords from 0 to 1000. If I change the code to
formGraphics.DrawImage(image, 50000, 2800000, 25000, 25000);
This previous code then puts the map WAY offscreen to the south-east ! I tried fiddling with the following code but no luck.
formGraphics.DrawImageUnscaledimage,0,0);
formGraphics.DrawImageUnscaledAndClipped(image, rect1);please help ! Thanks Ian