How to handle very large images efficiently?

General TRichView support forum. Please post your questions here
Post Reply
exacord52
Posts: 1
Joined: Sun May 11, 2025 9:17 pm

How to handle very large images efficiently?

Post by exacord52 »

Hi everyone,
I'm working on an application that allows users to insert very large images (sometimes exceeding 10MB) into a TRichViewEdit. The images are displayed, but performance becomes a real issue, especially when scrolling or editing.
I've tried several approaches, including:
* Resizing images before inserting them. This improves performance somewhat, but users complain about the loss of detail.
* Using `RVStyle.BitmapCache` to cache scaled versions of the images. This also helps, but the cache can quickly fill up, leading to out-of-memory errors.
* Loading images asynchronously. This prevents the UI from freezing, but the image display is jerky.
Does anyone have any suggestions on how to efficiently handle very large images in TRichViewEdit? Are there any specific properties or settings that I should be aware of? Are there any alternative approaches that I should consider?
Specifically, I'm looking for:
* Techniques to minimize memory usage when displaying large images.
* Strategies to improve scrolling and editing performance.
* Methods to avoid out-of-memory errors.
* Examples or code snippets demonstrating best practices.
Any help or guidance would be greatly appreciated!
Thanks in advance,
[Your Name]
Sergey Tkachenko
Site Admin
Posts: 17836
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to handle very large images efficiently?

Post by Sergey Tkachenko »

TRichViewEdit automatically caches scaled copies of images (in VCL and Lazarus version), so scaled images must be displayed fast after the first redrawing.
There is no RVStyle.BitmapCache.
And how do you load images asynchronously?
Post Reply