Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Drawing a big topographic map in its own coordinates

Drawing a big topographic map in its own coordinates

Scheduled Pinned Locked Moved Graphics
graphicshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ianhunt01
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups