pictures and speed

Fred.Stephenson Fred.Stephenson at communication-unltd.com
Fri Nov 5 09:12:41 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.


a) does assigning the thumbnail to listbox.rowpicture(index) not work?
b) can't you store your thumbnails uncompressed in the database?
c) maybe datagrid from einhugur would be quicker

just a quick couple of immediate thoughts.

Fred
-- 
Great Britain was given
  God to Save the Queen
and
the NHS to kill her subjects
[Fred Stephenson August 27 2004]


More information about the Valentina mailing list