[Lazarus] Graphics changes (r15472)

Marc Weustink marc.weustink at cuperus.nl
Fri Jun 20 11:58:51 CEST 2008


Luiz Americo Pereira Camara wrote:
> 
> One old issue i have with TBitmap (not introduced now but that could
> be resolved with this refactoring) is that when a image is loaded
> with LoadFromStream or LoadFromFile a copy of the image buffer is
> kept in memory. This can speedup if is necessary to access the image
> data directly but for the more common case of loading a file to
> display is waste of memory.

This is no error, this is by design. And is only kept once and as long 
as the image isn't changed. Indeed, for cases where you know you never 
want to save it, we can add an property.

> There's also another problem with it: if the image is modified using 
> LCLIntf functions like BitBlt the buffer will not be updated and next 
> time SaveToFile/Stream is called, the buffer (with the outdated data) 
 > will be used.

Which buffer do you mean ?

> Maybe a TBufferedImage class or an option can be added.

Not all modification functionality is fully implemented. IOW, these 
changes still need some work.

Marc



More information about the Lazarus mailing list