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