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. WPF
  4. WPF Pan limitation

WPF Pan limitation

Scheduled Pinned Locked Moved WPF
csharpwpf
5 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.
  • D Offline
    D Offline
    DavJes
    wrote on last edited by
    #1

    Hi, I did a application (WPF) which has ImageContrl inside a Border, and using mouse we can Zoom and Pan the control. It works fine except that while Panning the image after zoom, it moves out of the viewport of the Border. Can any one throw me light on hw to solve this

    D 1 Reply Last reply
    0
    • D DavJes

      Hi, I did a application (WPF) which has ImageContrl inside a Border, and using mouse we can Zoom and Pan the control. It works fine except that while Panning the image after zoom, it moves out of the viewport of the Border. Can any one throw me light on hw to solve this

      D Offline
      D Offline
      Daniel Vaughan
      wrote on last edited by
      #2

      One thing to be aware of when using a ScaleTransform is that it does not affect the size of the element you are scaling. If you are panning your object by a value that corresponds to the ActualWidth/Height then it might explain why it is panning incorrectly. Perhaps multiply the scale amount with your ActualWidth/Height to get its 'real' screen dimensions. Cheers, Daniel

      Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn

      P 1 Reply Last reply
      0
      • D Daniel Vaughan

        One thing to be aware of when using a ScaleTransform is that it does not affect the size of the element you are scaling. If you are panning your object by a value that corresponds to the ActualWidth/Height then it might explain why it is panning incorrectly. Perhaps multiply the scale amount with your ActualWidth/Height to get its 'real' screen dimensions. Cheers, Daniel

        Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Good answer Dan. Good to see you here among the mortals. ;)

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        D 1 Reply Last reply
        0
        • P Pete OHanlon

          Good answer Dan. Good to see you here among the mortals. ;)

          I'm not a stalker, I just know things. Oh by the way, you're out of milk.

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          D Offline
          D Offline
          Daniel Vaughan
          wrote on last edited by
          #4

          Thanks Pete! The awesome work you do on the CP technical forums blows my mind. Cheers, Daniel

          Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn

          P 1 Reply Last reply
          0
          • D Daniel Vaughan

            Thanks Pete! The awesome work you do on the CP technical forums blows my mind. Cheers, Daniel

            Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Gosh, thanks. Coming from you Dan, that means a heck of a lot. BTW - I've got my preorder in for WP7 Unleashed.

            I'm not a stalker, I just know things. Oh by the way, you're out of milk.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            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