pictures and speed

Ralf Sander ralf at end-if.de
Thu Nov 4 23:23:30 CST 2004


I am planning a picture database with realbasic that should provide a 
thumbnail view and made some quick tests with valentina to observe the 
best and fast way it could be done.

1. way
Storing all pictures in a temporary array is fast at display but slow 
on request, because all pictures need to be decompressed at once and 
also slow at sorts etc, because it needs to be refilled every time. 
Also it takes a lot of ram.

2. way
Storing all pictures in an array, but only the viewed at request and 
the not yet invisible in a following thread.
Ok, but a lot of work to eleborate on the scrollbar position etc to 
create a smooth viewing experience.

3. way
Getting pictures from the db when they are needed (draw event):

I tried with a standard listbox and the "backgroundpaint" event:

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

(I need to create a new picture here, because direct drawing draws 
anywhere on the screen (bug?))
This solution is really to slow ( scrolling ). I think, because of the 
decompressing time for the pictures.


Have anyone any other idea, how I could realize this as fast as 
possible.

Thanks,
Ralf



More information about the Valentina mailing list