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. Scroll + DrawImage Help

Scroll + DrawImage Help

Scheduled Pinned Locked Moved C#
help
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.
  • J Offline
    J Offline
    jk chan
    wrote on last edited by
    #1

    Hi Guys :) My project is to dispaly the image in a usercontrol. and user will be able to scroll it. But when the image is too large (say width = 2592,Height=1952) the scrolling becomes slow.. means repaining become slow. Am using DrawImage for displaying the imag. and used TranslateTransform for acheving scrolling.. Used Separate scrolbars instead of setting AutoScroll. Where the things went to wrong . Pls corrcet me Regards :cool: Krishnan If u can Dream... U can do it

    C R 2 Replies Last reply
    0
    • J jk chan

      Hi Guys :) My project is to dispaly the image in a usercontrol. and user will be able to scroll it. But when the image is too large (say width = 2592,Height=1952) the scrolling becomes slow.. means repaining become slow. Am using DrawImage for displaying the imag. and used TranslateTransform for acheving scrolling.. Used Separate scrolbars instead of setting AutoScroll. Where the things went to wrong . Pls corrcet me Regards :cool: Krishnan If u can Dream... U can do it

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Use DrawImage to draw only the bit you can see, instead of all of it. In theory it shouldn't matter ( I don't think ), but in practice it obviously does, as the size of an image is having an effect in your code. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      J 1 Reply Last reply
      0
      • C Christian Graus

        Use DrawImage to draw only the bit you can see, instead of all of it. In theory it shouldn't matter ( I don't think ), but in practice it obviously does, as the size of an image is having an effect in your code. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        J Offline
        J Offline
        jk chan
        wrote on last edited by
        #3

        Thanks for ur reply. Can u explain it more . u means that there is no solution to this problem ?:( but when i opening a large image with internet explorer or paint , i can scroll the image smoothly. So i strongly belive that there is a solution to this. Regards Krishnan If u can Dream... U can do it

        C 1 Reply Last reply
        0
        • J jk chan

          Hi Guys :) My project is to dispaly the image in a usercontrol. and user will be able to scroll it. But when the image is too large (say width = 2592,Height=1952) the scrolling becomes slow.. means repaining become slow. Am using DrawImage for displaying the imag. and used TranslateTransform for acheving scrolling.. Used Separate scrolbars instead of setting AutoScroll. Where the things went to wrong . Pls corrcet me Regards :cool: Krishnan If u can Dream... U can do it

          R Offline
          R Offline
          Robert Rohde
          wrote on last edited by
          #4

          Have you tried using a PictureBox setting it SizeMode to AutoSize and just let the user control handle the scrolling with AutoScroll set to true? If thats not working you should avoid using TranslateTransform as its a heavy function. If you pass negativ coordinates to your DrawImage function it should also work (as everything which cannot be drawn is simply clipped away). And dont use DrawImage, use DrawImageUnscaled instead (unless you need to scale).

          1 Reply Last reply
          0
          • J jk chan

            Thanks for ur reply. Can u explain it more . u means that there is no solution to this problem ?:( but when i opening a large image with internet explorer or paint , i can scroll the image smoothly. So i strongly belive that there is a solution to this. Regards Krishnan If u can Dream... U can do it

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            I am saying that instead of using a transform, you should just draw the bit you want to see. Most DrawImage functions take a rect that defines the part of the bitmap to draw. Use them. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

            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