-
Content Count
27 -
Joined
-
Last visited
Community Reputation
0 Neutral-
I thought I needed to use the TKernelResampler to get a nice resize but TDraftResampler looks good and panning is almost as good as panning of the full size image. This is good enough for me!
-
I have it set to rmOptimized. I set the breakpoint and the program stopped at that location so I am using the latest version of the unit. The bitmap I work with in my project is 5500 by 4000. The viewport is 1700 by 1000. I am goin to try scaling the bitmap first using the drawto method and then assign it to the image for the scrolling. I think (hope) that will avoid the problem as the image will always be at full scale, as far as it knows. What do you think?
-
OK. I put the new unit in the project folder and recompiled. The new .dcu file for GR32_Image.pas is in the debug folder. But I am not seeing any change in the scrolling - still really lagging.
-
@Anders Melander Excellent! - I will try it out as soon as I can. What's the easiest way to get this into Delphi, reinstall Graphics32 from scratch? Is there a way to just recompile GR32_Image.pas? And then what - sorry I don't have much experience working with 3rd party stuff.
-
I played around with the resampler kernel and that makes a big difference. I started using Mitchell but when I switched to Box the scrolling was much smoother but the scaling wasn't as nice. I am surprised that the image is resampled when it is scrolled as the size is not changing. I am going to try scaling a bitmap and then assigning that to the image before scrolling.
-
Anders, One more question on scrolling. When I zoon in on the bitmap (scale<1) the scrolling is really slow, there is quite a bit of lag. When scale = 1 there is no lag. Is it doing a rescaling ever time it moves the image 1 pixel? I have been looking at the code and I don't see it but that would explain the lag I think.
-
Solved! This is where ControlToBitmap(Point(X, Y)) comes in handy.
-
Looking at GR32_image.pas I see properties hscroll.position and vscroll.position that should give me what I want. But I can't figure out how to get at them...
-
...of course, I have more questions! Now my problem is I need to know the location of the cursor above the image, not just the viewport. I thought I could use the offsethorz and offsetvert properties. They sound like they should give me the position of the image relative to the viewport. However, they don't appear to contain any information. Also, the manual says they are type single but in reality they are type extended. I am not sure what they are intended to provide. Is there a property of the image that contains the offsets relative to the viewport?
-
Thanks for your help. I now have a nicely scaled image that scrolls smoothly. Onwards!
-
That works very nicely, thanks! I see you removed ImgView.ControlToBitmap(Point(X, Y)). I was trying to figure out exactly what that did...
-
I have narrowed down the problem to when image.scale is less than 1. If it is 1 or larger the scrolling works very nicely, very smooth. When it is less than 1 it gets wonky.
-
I am using smScale. I'll take a look at your example though. Thanks.
-
I played around with the code by adding a couple of buttons to change the image scale. I found that when the scale is not 1 the scrolling is a mess - the image jumps around and doesn't follow the cursor. When the scale is 1 the scrolling works great. Any ideas?
-
OK, it appears TImgView32 is a combination of an image and a scroll box. Cool.