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 / C++ / MFC
  4. On vertical and horizontal scroll

On vertical and horizontal scroll

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 4 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.
  • V Offline
    V Offline
    vandana7
    wrote on last edited by
    #1

    I m opening the image in OnFileOpen() but when i scroll vertically or horizontally it disappears. When done from OnDraw it is doing fine.Please Help.

    S H A 3 Replies Last reply
    0
    • V vandana7

      I m opening the image in OnFileOpen() but when i scroll vertically or horizontally it disappears. When done from OnDraw it is doing fine.Please Help.

      S Offline
      S Offline
      SandipG
      wrote on last edited by
      #2

      when you will scroll the window it will be repainted always. if you want the the image to be displayed all time you have to handle in OrDraw/OnPaint only.

      1 Reply Last reply
      0
      • V vandana7

        I m opening the image in OnFileOpen() but when i scroll vertically or horizontally it disappears. When done from OnDraw it is doing fine.Please Help.

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        I dont understand,can you more explain?

        V 1 Reply Last reply
        0
        • H Hamid Taebi

          I dont understand,can you more explain?

          V Offline
          V Offline
          vandana7
          wrote on last edited by
          #4

          i m opening a image in OnFileOpen function it opens finebut when i start scrolling it disappears. When the it is done in OnDraw function it is displaying image while scrolling. Please Help.

          1 Reply Last reply
          0
          • V vandana7

            I m opening the image in OnFileOpen() but when i scroll vertically or horizontally it disappears. When done from OnDraw it is doing fine.Please Help.

            A Offline
            A Offline
            Alan Balkany
            wrote on last edited by
            #5

            First you need handler methods for scrolling, which update the scrolled coordinates (usually the upper-left corner's coordinates). In these methods add: Invalidate (); The Invalidate () method will cause OnDraw () to be invoked. Your OnDraw () method should draw the image, starting at the current scrolled coordinates. An alternative is to use the CScrollView class, which handles scrolling for you. If you do this, the OnDraw () method should just draw the whole image.

            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