pictures and speed

Stephan Huber ratzfatz at digitalmind.de
Sat Nov 6 11:10:21 CST 2004


Ralf Sander wrote:

> Function CellBackgroundPaint(g As Graphics, row As Integer, column As 
> Integer) As Boolean
>      dim p as Picture
>      dim b as Boolean
>
>       if column=0 then
>          p=NewPicture(30,30,32)
>          b=mDataBase.mPerson.GoToRecID(row)
>          p.graphics.DrawPicture mDataBase.mPerson.PictFld.GetPicture,0,0
>          g.DrawPicture p,0,0,30,30
>       end
>       return true
>
> End Function


You should cache your pictures. You load everytime a new picture when 
the row is repainted, even if the picture is already loaded. This is 
unnecessary. And there are even niftier possibilities. I think iPhoto is 
using different sized preview-pictures, so in the first step you can 
load all lo-res previews, so scrolling speed is fast, when the user 
stops scrolling, you check the currently visible pictures and load the 
higher res previews and display them, and cache them also. If the cache 
hits a specified size, you clear the oldest images in the cache, if they 
are not visible.

This had worked for my imagedatabase (which i stopped to develop after I 
checked iView MediaPro)

HTH,
Stephan


-- 

Stephan Huber +++ http://digitalmind.de +++ dieses und jenes



More information about the Valentina mailing list