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. C#
  4. Large Image Pixel problem

Large Image Pixel problem

Scheduled Pinned Locked Moved C#
helptutorialquestiondiscussion
4 Posts 3 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.
  • R Offline
    R Offline
    R Myers
    wrote on last edited by
    #1

    I have a program that loads in a large image (14000x10000 pixels) & resizes the image to fit on the screen. Once it is resized I track the pixel that the mouse is over. This is reported back as the actual location on the screen (somwhere within the 1280x1024 of the screen resolution). I would like to know how to get the actual location within the larger image. Any thoughts? Thanks R.Myers

    G L 2 Replies Last reply
    0
    • R R Myers

      I have a program that loads in a large image (14000x10000 pixels) & resizes the image to fit on the screen. Once it is resized I track the pixel that the mouse is over. This is reported back as the actual location on the screen (somwhere within the 1280x1024 of the screen resolution). I would like to know how to get the actual location within the larger image. Any thoughts? Thanks R.Myers

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Just multiply the coordinates with the same scale that you used to shrink the image.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      • R R Myers

        I have a program that loads in a large image (14000x10000 pixels) & resizes the image to fit on the screen. Once it is resized I track the pixel that the mouse is over. This is reported back as the actual location on the screen (somwhere within the 1280x1024 of the screen resolution). I would like to know how to get the actual location within the larger image. Any thoughts? Thanks R.Myers

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        If you select one pixel on your screen, the corresponding location on the original image would be an entire rectangle with approx dimensions of 12*14; its location can be found as Guffa already explained, as well as its exact size. :)

        Luc Pattyn [My Articles] [Forum Guidelines]

        R 1 Reply Last reply
        0
        • L Luc Pattyn

          If you select one pixel on your screen, the corresponding location on the original image would be an entire rectangle with approx dimensions of 12*14; its location can be found as Guffa already explained, as well as its exact size. :)

          Luc Pattyn [My Articles] [Forum Guidelines]

          R Offline
          R Offline
          R Myers
          wrote on last edited by
          #4

          Thanks Luc & guffa. I think that'll work. (It looks pretty obvious when you said it :) ) R.Myers

          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