Anders Melander 1782 Posted January 6, 2021 @wadepm Here's the branch with the optimized scroll: https://github.com/graphics32/graphics32/tree/TImgView32_optimized_scroll Note that the optimization only comes into play if you're not using the rmFull repaint mode (see TImgView.RepaintMode). Give it a spin! 1 Share this post Link to post
wadepm 0 Posted January 6, 2021 @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. Share this post Link to post
Anders Melander 1782 Posted January 6, 2021 1 minute ago, wadepm said: What's the easiest way to get this into Delphi, reinstall Graphics32 from scratch? The design time functionality hasn't changed so you don't need to recompile the packages. The easiest way to test it out would be to just copy the modified GR32_Image.pas to the source folder of your application. That way your application will compile with the new GR32_Image but your existing Graphics32 installation will not be affected. Once the changes are merged into the main Graphics32 branch you can update your Graphics32 installation and remove the local copy of GR32_Image. 1 Share this post Link to post
wadepm 0 Posted January 6, 2021 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. Share this post Link to post
Anders Melander 1782 Posted January 6, 2021 9 minutes ago, wadepm said: But I am not seeing any change in the scrolling - still really lagging. Did you set ImgView.RepaintMode=rmOptimized ? Try to set a breakpoint in line 2380 of GR32_Image ("SourceRect := GetBitmapRect;") to verify that the correct version is being used. Can you reproduce the problem with the small example that I posted earlier (remember to make the changes I later mentioned and set RepaintMode): Share this post Link to post
wadepm 0 Posted January 6, 2021 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? Share this post Link to post
Anders Melander 1782 Posted January 6, 2021 (edited) 1 hour ago, wadepm said: The bitmap I work with in my project is 5500 by 4000. The viewport is 1700 by 1000. I tried with a 5500x4000 bitmap and I did actually manage to produce some lag. I then changed the resampler to TDraftResampler and the lag was completely gone. Same with TNearestResampler. Edited January 6, 2021 by Anders Melander Share this post Link to post
wadepm 0 Posted January 6, 2021 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! Share this post Link to post